Matrix dimensions¶
These functions allow to recover the dimensions of a matrix : total number of elements (see numel), dimensions (see size), etc.
length¶
nnz¶
numel¶
size¶
-
template<typename T>
matrix<std::size_t> castor::size(matrix<T> const &A)¶ Size of array.
S = size(A) for m-by-n matrix A returns the two-element vector [m,n] containing the number of rows and columns in the matrix.
S = size(A,dim) returns the lengths of the specified dimensions dim.
matrix<> A = {{1,2,3},{4,5,6}}; disp(size(A)); disp(size(A,1)); disp(size(A,2));