Determining size in matlab

d = size(X) returns the sizes of each dimension of array X in a vector d with ndims(X) elements. If X is a scalar, which MATLAB software regards as a 1-by-1 array, size(X) returns the vector [1 1].

Example

>> a = [1 2 3 4 5 6 7]

a =

     1     2     3     4     5     6     7

>> size(a)

ans =

     1     7