cell配列内に含まれる各配列のlengthをfor文を用いずに出力する方法
Ältere Kommentare anzeigen
cell配列内に含まれる各配列のlengthをfor文を用いずに出力する方法はありますか?
たとえば、以下の処理をfor文を用いずに、少ないステップ数で処理する方法はありますか?
cellA={ones(1,2);ones(1,3);ones(1,4)}
N_elements=zeros(3,1);
for i=1:length(cellA)
N_elements(i)=length(cellA{i});
end
N_elements
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu ループと条件付きステートメント finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!