Effacer les filtres
Effacer les filtres

A question on Matlab functions

2 vues (au cours des 30 derniers jours)
Ampi
Ampi le 12 Fév 2013
Hello everybody,
I had written a code for a input dialog box in matalb & the code is as follows.The following is my main function:-
hsurf_queue = uicontrol(...,
'Style','pushbutton',...
'Position',[10,350,110,30],...
'String','Open 3D raw file',...
'TooltipString','BusyAction = queue',...
'BusyAction','queue',...
'Callback',@surf_queue);
Now surf_queue is a function which is defined as:-
function [t]= surf_queue(hObject,eventdata)
t=1;
end
My question is that I want to return and print the value of t in main fucntion, how shall I do it ? My problem is if i add a line like:- t=surf_queue() , 2 times the function surf_queue is being called, i.e one in this line & the other one in uicontrol. Is there any one function whcich could be called to initilize a dialog window as well as print the return value of the function so that I could use the value of t in some other functions.
Thanks in advance for any help.

Réponses (1)

Walter Roberson
Walter Roberson le 12 Fév 2013
Note that callbacks of this style cannot return any values; they can only set values in places that other routines know to look for them.

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by