Matlab reshape function three-dimensional matrix

Source: Internet
Author: User
Tags rand
3-dimensional matrix dimension: row, column, page such as matrix A (m,n,w), M is row, N is column, W is page. When reshape a 3-D matrix, the elements of the matrix are taken in column order. First take the 1th page of the row, and then take the 2nd page, and so on. >> A=rand (2,2,2) A (:,:, 1) = 0.6787 0.7431 0.7577 0.3922 A (:,:, 2) = 0.6555 0.7060 3-dimensional matrix dimension: row, column, A page such as matrix A (m,n,w), M is a row, n is a column, and W is a page. When reshape a 3-D matrix, the elements of the matrix are taken in column order. First take the 1th page of the row, and then take the 2nd page, and so on.    >> A=rand (2,2,2) A (:,:, 1) = 0.6787 0.7431 0.7577 0.3922 A (:,:, 2) = 0.6555 0.7060 0.1712 0.0318 >> reshape (a,1,8) ans = 0.6787 0.7577 0.7431 0.3922 0.6555 0.1712 0.7060 0.0318 Order of values is: 1th 1th column A (:, all)-1th page 2nd Column A (:, 2,1)-2nd page 1th column A (:, all)-2nd page 2nd Column A (:, 2,2)

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.