BayesianLogic / blog

The BLOG programming language
http://bayesianlogic.github.io/
BSD 4-Clause "Original" or "Old" License
98 stars 31 forks source link

Add slice() and size() functions for Matrix #291

Open datang1992 opened 10 years ago

datang1992 commented 10 years ago

We could add slice() and size() functions for Matrix. Where

slice(Matrix M, Integer a, Integer b, Integer c, Integer d) = M(a:b, c:d) (as it is in Matlab).

and

size(Matrix M, 1) = number of rows in M; size(Matrix M, 2) = number of columns in M;

(Or we could also call the two size functions as numOfRow() and numOfColumn()).

jxwuyi commented 10 years ago

Probably submat() will be better I think.

From my iPhone

ÔÚ 2014Äê7ÔÂ31ÈÕ£¬4:04£¬Da Tang notifications@github.com дµÀ£º

We could add slice() and size() functions for Matrix. Where

slice(Matrix M, Integer a, Integer b, Integer c, Integer d) = M(a:b, c:d) (as it is in Matlab).

and

size(Matrix M, 1) = number of rows in M; size(Matrix M, 2) = number of columns in M;

(Or we could also call the two size functions as numOfRow() and numOfColumn()).

¡ª Reply to this email directly or view it on GitHub.

lileicc commented 10 years ago

question, can you define it within blog (using fixed function)?

datang1992 commented 10 years ago

@lileicc Yes, we could define these functions using fixed functions. If you approve, I will add them.