A question on Matlab functions

2 次查看(过去 30 天)
Ampi
Ampi 2013-2-12
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.

回答(1 个)

Walter Roberson
Walter Roberson 2013-2-12
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.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by