cell配列内に含まれる各配列のlengthをfor文を用いずに出力する方法
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on ループと条件付きステートメント in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!