LOOP in matlab (for)

1 view (last 30 days)
daniel alves
daniel alves on 6 May 2015
Edited: James Tursa on 6 May 2015
I need a loop for that sequence.
T_01=U_01(:,:,1)';
T_01(T_01==0)=nan;
i've got U_01:U_60 so i need T_01:T_60
Anyone knows how to make that loop?
Thank you

Accepted Answer

James Tursa
James Tursa on 6 May 2015
Edited: James Tursa on 6 May 2015
It appears you have multiple variables in your workspace with names such as U_01, U_02, ... U_60 and you want to make more of these using T. There is a way to construct a loop to process these names using the "eval" function, but as you can already see it is a real pain to deal with variables such as this in your code. The best advice I can give you is to abandon this approach and use cell or struct or multi-dimensional variables instead. E.g., see this link:

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!