Reshape: Math lesson help
이전 댓글 표시
Can someone help me with a mathmatics problem?
I have a 5x50 matrix? similar to that of a 5x5x10, but instead of columns the matrix has been organized horizontally.
x1 x1 x1 x1 x1 x2 x2 x2 x2 x2... x5 x5 x5 x5 x5
x1 x1 x1 x1 x1 x2 x2 x2 x2 x2... x5 x5 x5 x5 x5
x1 x1 x1 x1 x1 x2 x2 x2 x2 x2... x5 x5 x5 x5 x5
x1 x1 x1 x1 x1 x2 x2 x2 x2 x2... x5 x5 x5 x5 x5
x1 x1 x1 x1 x1 x2 x2 x2 x2 x2... x5 x5 x5 x5 x5
I would like an algorithm lesson on how to reshape the matrix such that,
x1 x2 x3 x4 x5
x1 x2 x3 x4 x5
. . . . .
. . . . .
. . . . .
x1 x2 x3 x4 x5
Each variable represnts a value that is close but not exactly the same. ie: x1 = 1.1, 1.2, 1.0, 1.1...
and x2 is
2.1, 2.2, 2.1, 2.3....
and so on
The purpose is for data analysis.
This is my partial answer:
%if B is equal to the matrix described above:
B = reshape(B,25,5,2)
Partial because I don't want to store the matrix as two seperate sections but as a complete column such that the matrix is a 50x5.
Can someone explain to me how this math works if I am correct? Also if anybody has a faster/better method that would be awsome.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!