作者hnuuy (tintato)
看板MATLAB
标题[讨论] 三维矩阵资料转成二维且横的排
时间Thu Mar 26 02:10:06 2015
请教各位大大
若 data <12x40x43700 double>
要如何转成二维的资料且是从横的开始排呢?
变成这样
temp <43700x480 double>
有试过reshape 不过他是从直的开始排
以下是我使用的方式
temp = reshape(data,43700,480);
请问应该要使用什麽指令呢?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.115.155.201
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1427307013.A.D45.html
1F:推 sunev: permute 03/26 03:15
permute试不太出来
试过发现可以这样
temp = reshape(data,480,43700);
x=temp';
※ 编辑: hnuuy (140.115.155.201), 03/26/2015 11:51:54
2F:→ DKer: 两行可以缩成一行吧 temp=reshape(data,480,43700)'; 03/26 14:01
3F:推 sunev: permute 是transpose的推广,在你的情况下可以写成 03/26 20:04
4F:→ sunev: temp=reshape(permute(data,[3 1 2]),43700,[]); 03/26 20:06
5F:→ sunev: 或是temp=premute(reshape(data,480,[]),[2 1]); 03/26 20:06