eval for string to variable
Mostrar comentarios más antiguos
I have a GUI with a string as variable and a returned value for it.
var="simulation type"
returned GUI value:
DataEdit.Value = 1x1 cell array {'RUN 1'}
eval([var '=' char(DataEdit.Value) ';']) gives Error using eval, Argument must be a text scalar.
Any suggestions?
2 comentarios
Stephen23
el 17 de Oct. de 2023
"Any suggestions?"
The fact that EVAL lets you obfuscate such buggy code should be a big hint that this should be avoided.
Walter Roberson
el 17 de Oct. de 2023
And when the XML file has in it
app = ''
then should your code delete your GUI, writing over the app variable that is holding the framework of your entire GUI ?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!