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

 Réponse acceptée

madhan ravi
madhan ravi le 12 Juin 2020

0 votes

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

5 commentaires

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by