我有一个3x3x2000的旋转矩阵阵列,需要转换为2000x9的阵列。Matlab:将三维阵列重塑为二维阵列
我想我必须使用permute()和reshape()的组合,但我没有得到正确的输出顺序。
这就是我需要:
First row of 3x3 array needs to be columns 1:3 in the output
Second row of 3x3 array needs to be columns 4:6 in the output
Third row of 3x3 array needs to be columns 7:9 in the output
我在下面的代码试图数目的所有可能的组合1 2 3:
out1 = permute(input, [2 3 1]);
out2 = reshape(out1, [2000 9]);
但我总是错误的顺序结束。 Matlab新手的任何提示?
举一个输入**和**所需输出的小例子,它将帮助潜在的志愿者知道他们是否得到对的。提示:您可能不得不在转换中包含一些转置('。')操作,并且不要忘记_Matlab_是'主要列'(例如_linear索引按列而不是lines_工作)。 – Hoki