pre allocating vector for loop
4 ビュー (過去 30 日間)
古いコメントを表示
Can any one tell how to pre allocate c1?
thanks
for ii = 1:length(a11);
c1=cross(L1(1,:),a11(ii,:));
end
0 件のコメント
採用された回答
madhan ravi
2020 年 6 月 12 日
c1 = cell(numel(a11),1); % before loop use numel instead of length
c1{ii} = ... inside loop
5 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!