I want to convert 3D (6x4x5 double) data to 2D data

5 次查看(过去 30 天)
abc(:,:,1) = [12.267 15.474 14.853 12.596;...
3.363 5.757 6.203 6.179;...
2.050 2.905 3.046 3.190;...
1.643 2.343 2.487 2.572;...
1.544 2.166 2.225 2.221;...
1.504 2.046 2.012 1.971];
abc(:,:,2) = [11.952 15.429 14.815 12.543;...
3.048 5.712 6.164 6.125;...
1.735 2.860 3.008 3.137;...
1.328 2.298 2.449 2.519;...
1.229 2.120 2.187 2.168;...
1.189 2.001 1.973 1.918];
abc(:,:,3) = [12.396 15.777 15.032 12.734;...
3.492 6.060 6.381 6.317;...
2.178 3.208 3.225 3.329;...
1.771 2.646 2.666 2.711;...
1.673 2.469 2.404 2.360;...
1.632 2.349 2.190 2.110];
abc(:,:,4) = [13.192 16.259 15.481 13.098;...
4.288 6.542 6.831 6.681;...
2.975 3.690 3.674 3.693;...
2.567 3.128 3.115 3.075;...
2.469 2.951 2.853 2.724;...
2.428 2.831 2.639 2.474];
abc(:,:,5)= [13.819 16.658 15.806 13.352;...
4.915 6.942 7.156 6.935;...
3.602 4.090 3.999 3.947;...
3.195 3.527 3.440 3.329;...
3.096 3.350 3.178 2.978;...
3.056 3.230 2.965 2.728];
  2 个评论
Rik
Rik 2019-5-24
How should this data be reshaped to 2D? There are many ways to do that, which of them do you mean?
Bhavnish
Bhavnish 2019-5-24
编辑:Bhavnish 2019-5-24
It will be good if it can be converted into 1xN double format.
When the data will be in the double format, I want to use mat2str function on the same.
For mat2str function the input data must be 2-D matrix.

请先登录,再进行评论。

采纳的回答

KSSV
KSSV 2019-5-24
A = rand(2,2,3) ;
out = reshape(permute(A, [2 1 3]), size(A, 2), [])'
  3 个评论
Bhavnish
Bhavnish 2019-5-24
KSSV, can you please help in converting the same 3-D data to a character string which I have pasted in my original question?
I am trying to see which will fit good for the requirement.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

产品


版本

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by