uicontrol callback 'disp
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, when I input the following line of code into the Matlab command window: h = uicontrol('style', 'pushbutton', 'string', 'Hello', 'position', [20 150 100 70],'callback', 'disp("Hello World")');
it seems to work because a user interface comes up with no initial error with a button that has the words Hello World on it. But then when I press the button I get the following error:
??? Error using ==> disp("Hello World") Error: The input character is not valid in MATLAB statements or expressions.
??? Error while evaluating uicontrol Callback
What could I be doing wrong? I got the simple callback example from a Matla basic GUI Programming manual.
Thanks for any suggestions.
0 Commenti
Risposta accettata
Paulo Silva
il 12 Apr 2011
h = uicontrol('style', 'pushbutton', 'string', 'Hello', 'position',...
[20 150 100 70],'callback', 'disp(''Hello World'')');
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!