How to run a custom command from a UI
Mostrar comentarios más antiguos
Hi,
I'm designing a UI for plotting various instrumental data. However, I'd like to have a text field in which the user can enter any Matlab command they want and have it executed, as if they were using the Matlab console. The command would be entered as standard Matlab syntax, and would be processed as follows:
function SomeButtonPushed(app, event)
command = app.aTextField.Value;
% Some code to execute command
end
I would also like to get the console output (or whatever equivalent) in terms of error messages etc.
Is this possible? If so, how should I go about it?
Many thanks in advance.
2 comentarios
"...in which the user can enter any Matlab command they want and have it executed..."
Does this include, for example, commands like (pseudocode):
system format my entire harddrive
quit MATLAB
delete everything in the workspace
reallocate any variable used in your code
system uninstall MS Office
"Is this possible? If so, how should I go about it?"
evalc
Guy Stimpson
el 23 de Dic. de 2019
Editada: Guy Stimpson
el 23 de Dic. de 2019
Respuesta aceptada
Más respuestas (1)
Categorías
Más información sobre File Operations 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!