cell配列内に含まれる各配列のlengthをfor文を用いずに出力する方法
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 ループと条件付きステートメント 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!