How to run a custom command from a UI
Afficher commentaires plus anciens
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 commentaires
"...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
le 23 Déc 2019
Modifié(e) : Guy Stimpson
le 23 Déc 2019
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur File Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!