How to reshape array items and put them in a single cell

2 ビュー (過去 30 日間)
Phoenix98
Phoenix98 2018 年 10 月 3 日
編集済み: Stephen23 2018 年 10 月 3 日
Hello,
I have 360x1280 numeric array and I want to reshape each of 360 items to 10x128 and store the image array as a cell row using for loop?

回答 (2 件)

KSSV
KSSV 2018 年 10 月 3 日
I = rand(360,1280) ;
iwant = cell(1280,1) ;
for i = 1:1280
iwant{i} = reshape(I(:,i),10,128)) ;
end

Stephen23
Stephen23 2018 年 10 月 3 日
編集済み: Stephen23 2018 年 10 月 3 日
Where M is your 360x1280 matrix:
C = squeeze(num2cell(reshape(M.',10,128,360),1:2));

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by