Get the numeric value of a variable using sprintf
Ältere Kommentare anzeigen
Hi,
How can I get the numerical value of a variable doing something like this:
num_1=2;
num_2=5;
num=3=9;
random_num=randsample([1 2 3],1)
Time=sprintf('num_%d',random_num)
Then I get Time=num_X but what I want is to get the numerical value associated to num_X
Any clue on how to do it?
Thank you very much.
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 25 Okt. 2015
0 Stimmen
Kategorien
Mehr zu MATLAB 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!