Loading variable from whos
Ältere Kommentare anzeigen
Hi I am working on a group of variables, and I want work on every of them changing them value in loop.
I grouped interested me variables by whos('I2*')
Thank You.
Akzeptierte Antwort
Weitere Antworten (1)
David Sanchez
am 18 Jun. 2013
Try this out:
my_vars=whos;
for k = 1:length(my_vars)
assignin('base',my_vars(k).name,value_to_assign)
end
where value_to_assign is jsut that, the value you want the variable to have.
1 Kommentar
ZK
am 18 Jun. 2013
Kategorien
Mehr zu Structures finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!