Say I have the following function:
function result=myfun(varargin)
result=[];
myFig=figure();
B1=uicontrol(myFig,'Style','pushbutton','String','done','Callback',{@done_Callback});
function done_Callback(varargin)
result =10;
delete(mainFig);
end
end
I am trying to only return output after the button callback is executed. Right now it returns an empty variable right away. I know how to do this in guide GUIs but all of my project is written without guide. I am assuming I need uiwait somewhere, but not sure where.