作者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/m.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