length of multiple vectors
Show older comments
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.
Answers (2)
evil_silla
on 29 Mar 2013
0 votes
1 Comment
Walter Roberson
on 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
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!