Can any one tell how to pre allocate c1?
thanks
for ii = 1:length(a11);
c1=cross(L1(1,:),a11(ii,:));
end

 採用された回答

madhan ravi
madhan ravi 2020 年 6 月 12 日

0 投票

c1 = cell(numel(a11),1); % before loop use numel instead of length
c1{ii} = ... inside loop

5 件のコメント

Oday Shahadh
Oday Shahadh 2020 年 6 月 12 日
c1 = cell(numel(a11),1);
madhan ravi
madhan ravi 2020 年 6 月 12 日
I don’t see the difference?
Oday Shahadh
Oday Shahadh 2020 年 6 月 12 日
Sorry what is hapening here?
I just commented " Madhani you are professional as usual'
Oday Shahadh
Oday Shahadh 2020 年 6 月 12 日
Then Madhani how can I switch all these cell arrays to ( n,3) matrix
Oday Shahadh
Oday Shahadh 2020 年 6 月 12 日
cell2mat

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by