FUNCTION REFERENCE
size
Size of an array.
Size of an array.
Syntax
size(A)Syntax
size(A, dim)Syntax
[r, c] = size(A)size(A) returns [rows columns]. size(A, 1) is rows, size(A, 2) is columns, larger dim gives 1.
For an LTI model, rows count outputs and columns count inputs.
Example
[r, c] = size(ones(2, 3)) % r = 2, c = 3Example
size(zeros(2,3,4),[1 3]) % [2 4]Differences from MATLAB: 2-D input has no size(A, [d1 d2]) form. N-D arrays (part 2): size(A,dim), size(A,vecdim), size(A,d1,d2,...) and [d1,...,dn] = size(A,...); without dimension arguments the last output folds the remaining dimensions.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.