Get a string from cell array?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Maria
am 13 Sep. 2014
Bearbeitet: Star Strider
am 13 Sep. 2014
Hi all,
I have a cell array of the variable names as:
varnames = {'t1', 't2', 't3', 't4'}
I have tried to save the variables using varnames in a loop as
save(variable,varnames(i)) and save(variable,varnames{i})
but both of them give an error "Argument must contain a string".
How can I get a string from the cell array?
Thanks already in advance!
Regards, Maria
I managed to solve this already. It works when the variable is given in quotation marks as 'variable'.
-Maria
0 Kommentare
Akzeptierte Antwort
Star Strider
am 13 Sep. 2014
Bearbeitet: Star Strider
am 13 Sep. 2014
The argument itself must be a string:
save('variable','varnames')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!