A brief introduction to the usage _javascript technique of size () function in MATLAB

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.