length of multiple vectors
Afficher commentaires plus anciens
I am new with Matlab and english it is not my first language, so please have me patience.
I want to know the length of 40 vectors (i created them with a loop and their names are A1, A2, ... , A40). I was thinking of using the command "for" but the problem is that i dont know how can i call 1 vector in each iteration.
Réponses (2)
evil_silla
le 29 Mar 2013
0 votes
1 commentaire
Walter Roberson
le 30 Mar 2013
Do not create your variables that way.
Instead of assigning to A10, assign to A{10}. Then when you want to loop over the vectors,
for K = 1 : length(A)
current_vector = A{K};
... work with current vector
end
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!