cell配列内に含まれる各配列のlengthをfor文を用いずに出力する方法
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre ループと条件付きステートメント en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!