In my gui function there is a sub function (fcn1) that I want to get its output (y) for a push button callback (fcn2) in the main function, but I cannot get the output of sub function: I appreciate if anyone can help;
function [V]=Problemsz=get(0,'ScreenSize');figure('numbertitle','off','menubar','none','position',[sz(3)/3 sz(4)/4 sz(3)/2.8 sz(4)/1.5]);uicontrol('style','text','string','Select equation','position',[20 450 180 35],'fontsize',12,'backgroundcolor','g','horizontalalignment','left');V.al=uicontrol('style','popup','string',{'choice A','Choice B'},...'position',[220 450 150 35],'fontsize',12,'backgroundcolor','w','horizontalalignment','left'); set(V.al,'callback',{@fcn1,V}); function [V]=fcn1(varargin) V=varargin{3}; if get(V.al,'value')==1 helpdlg('3/x+2*x^2+1','Ref. Eqaution'); else y=inputdlg('Vs=','User Equation',[1,33],{'sind(x)*x^2+1'}); end enduicontrol('style','pushbutton','string','ok','backgroundcolor','y','position',[200 20 30 30],'callback','[r]=fcn2(y);close');end
Best Answer