A question on Matlab functions
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!