The usage of the size () function in Matlab is briefly described.

Source: Internet
Author: User

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.

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.