Writing m*n matrix into single array

1 次查看(过去 30 天)
Abdul Gaffar
Abdul Gaffar 2017-11-3
编辑: dpb 2017-11-5
I want to write m*n matrix into single array
  4 个评论
Walter Roberson
Walter Roberson 2017-11-3
Yes? You can reshape(A,3,3) to get back the original ?
We do not understand what you are starting with and what you need to end up with ??
dpb
dpb 2017-11-4
编辑:dpb 2017-11-5
All the elements of A(:) are identical to those in the original A; only the shape was changed. The expansion to vector is in column-major order; that is each column is in turn appended to the preceding. This is internal Matlab storage order and an extremely important concept in learning to use the vector facilities within Matlab.
All that occurs is, as Walter notes, a reordering of the apparent shape such that matrix operations can be performed on the matrix according to the laws of matrix algebra or elemental operations on conformant arrays.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2017-11-3
YourMatrix(:)
would give a column vector containing the same elements, if that is what you want ?

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by