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!