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!