can pushbutton work without a function ????
Mostra commenti meno recenti
Hello guys, i'm having problems with a pushbutton. I created a pushbutton inside a figure, however i cant use a nested function or another .m file to make it work. This button should work as itself. This is the code.
button1=uicontrol(gcf,'style','pushbutton','string','Save projected points','Position', [20 140 150 40],'ButtonDownFcn','1'); %pushbutton
if ((str2double(get(button1,'string'))) == 1)
disp('u did it')
end
however this is not working, how to call the handles of the button or mayby just detect if this was pressed???
maybe is an stupid question, but thanx anyway
Risposta accettata
Più risposte (1)
Image Analyst
il 16 Set 2014
0 voti
You need to define a callback function. See this http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples if you insist on "rolling your own" GUIs instead of using GUIDE.
1 Commento
Jules Ray
il 17 Set 2014
Categorie
Scopri di più su Interactive Control and Callbacks in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!