Convert A String Into a MATLAB Variable Name
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I was trying to figure out if a had a string such as a= 'TEMP' and create a second variable which has the name TEMP which I would assign a corresponding value to. The problem is that I want to have 'TEMP' vary in a loop or as part of a function without have to manually assign it.
0 comentarios
Respuestas (2)
Sean de Wolski
el 7 de Jul. de 2011
Don't do it!
What if the variable name is 'size' or 'sum' or something useful and you overwrite a needed builtin function?
1 comentario
Chirag Gupta
el 7 de Jul. de 2011
This is useful in certain cases as shown in the examples
0 comentarios
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!