Filter löschen
Filter löschen

A question on Matlab functions

2 Ansichten (letzte 30 Tage)
Ampi
Ampi am 12 Feb. 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.

Antworten (1)

Walter Roberson
Walter Roberson am 12 Feb. 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.

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by