The usage of the size () function in Matlab is briefly described.
The size () function is used to obtain the number of rows and columns in the matrix.
(1) s = size (),
If there is only one output parameter, a row vector is returned. When the first element of the row vector is the number of rows in the matrix, the second element is the number of columns in the matrix.
(2) [r, c] = size (),
When there are two output parameters, the size function returns the number of rows in the Matrix to the first output variable r, and returns the number of columns in the Matrix to the second output variable c.
(3) size (A, n) if n is added to the input parameter of the size function and 1 or 2 is assigned to n, size returns the number of rows or columns in the matrix. Where r = size (A, 1) the number of rows returned by the statement, and c = size (A, 2) the number of columns returned by the statement.
In addition, length () = max (size ()).
Summary:
For matrix
Number of rows in size (A, 1) matrix
Number of columns in size (A, 2) matrix
[M, n] = size (A), m indicates the number of rows in matrix A, and n indicates the number of columns in matrix.
For the usage of the size () function in Matlab, I would like to introduce you so much and hope to help you with the above!
Articles you may be interested in:
- Introduction and Comparison of sizeof () and strlen () functions in C Language
- Explain how to use the free () function and getpagesize () function in C Language
- Php checks array length functions sizeof and count usage
- Parsing sizeof, strlen, pointer and array as function parameters
- Php Image Resize Function Code
- It is good to use the resizeTo and moveTo functions to implement the window's "playing table tennis" effect.