How to avoid for loop when indexing?
Afficher commentaires plus anciens
Hello,
I have the following for loop, where pairs(500x10), is there to calculate cc without for loop?
for i=1:500
cc(i,:)=pairs(i,pairs(i,:));
end
4 commentaires
Stephen23
le 2 Juil 2018
@Mantas Vaitonis: what is pairs2 ? What values do pair and pairs2 contain?
Mantas Vaitonis
le 2 Juil 2018
Modifié(e) : Mantas Vaitonis
le 2 Juil 2018
Stephen23
le 2 Juil 2018
@Mantas Vaitonis: given that pairs contains non-integer values, what do you expect
pairs(i,pairs(i,:));
to do?
Mantas Vaitonis
le 2 Juil 2018
Réponse acceptée
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!