|MATLAB Function Reference|
Length of vector
length(X) is equivalent to
max(size(X)) for nonempty arrays and
0 for empty arrays.
n = length(X)
returns the size of the longest dimension of
X is a vector, this is the same as its length.