The size () function is used to get the number of rows and columns of the matrix.
(1) s=size (A),
When there is only one output parameter, a row vector is returned, the first element of the row vector is the number of rows of the matrix, and the second element is the number of columns in the matrix.
(2) [R,c]=size (A),
When there are two output parameters, the size function returns the number of rows of the matrix to the first output variable R, returning the number of columns of the matrix to the second output variable C.
(3) Size (a,n) If you add an item n to the input parameter of the size function and assign a value of 1 or 2 to n, the size returns the number of rows or columns of the matrix. where R=size (a,1) returns the number of rows of the matrix A, c=size (a,2) the number of times matrix A is returned by the statement.
Also, Length () =max (Size ()).
Summarize:
For matrix A
Number of rows for size (a,1) matrix A
Number of columns of size (a,2) matrix A
[M,n]=size (a), M is the number of rows of matrix A, n is the number of columns in matrix A
Matlab on the size () function of the use of small series to introduce so many people, I hope that the above help!