I am trying to convert a character vector callback to a function handle. However, I am calling multiple callbacks which I assume I could create a cell array with anonymous functions?
Here is the code:
guiel.hPB(2)=uicontrol(guiel.cPanel(2),'Style','PushButton','Units','pixels',...
'TooltipString',guiel.plotTt,...
'Position',[cnst.bhspace 3*cnst.bvspace+2*cnst.bheight cnst.bwidth cnst.bheight],...
'String','Run Simulation','fontsize',10,'FontWeight','Demi',...
'CallBack','eval(codeblk.CLOSE_MDL_FCN); set(guiel.cPanel(4),''Visible'',''off'');set(guiel.APPWINDOW,''Resize'',''off''); primePlot;',...
'Enable','off');
What I am trying to do is to write codeblk.CLOSE_MDL_FCN
into a function handle and the rest to be anonymous function handles? However, I am not sure how I can do that.
codeblk.CLOSE_MDL_FCN = ['if ~isempty(find_system(''Name'',vars.simfilename))'...
'vars.simtime = str2num(get_param(vars.simfilename,''StopTime''));'...
'set(guiel.hSimtime,''String'',num2str(vars.simtime));'...
'save_system(vars.simfilename);'...
'close_system(vars.simfilename);'...
'end'];