pre allocating vector for loop
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Oday Shahadh
le 12 Juin 2020
Commenté : Oday Shahadh
le 12 Juin 2020
Can any one tell how to pre allocate c1?
thanks
for ii = 1:length(a11);
c1=cross(L1(1,:),a11(ii,:));
end
0 commentaires
Réponse acceptée
madhan ravi
le 12 Juin 2020
c1 = cell(numel(a11),1); % before loop use numel instead of length
c1{ii} = ... inside loop
5 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!