%FRACLDSV is a subroutine of "fractory.m" which stores and %retrieves the defining IFS data for the linear transfor- %mations created by FRACTORY. The data is stored in the %form of a 7xK matrix containing curdat(1:6)-like information. %The 7th entry is the value of the variable "fcnon". %Turn off buttons, etc ctlmode='off'; setwho=2; setctl ldsvon=1; Ab2CO=[0 1 0 0 1 0; 0 0 0 1 0 1; 0 0 0 0 1 0; 0 0 0 0 0 1; 1 0 0 0 1 0; 0 0 1 0 0 1]; CO2Ab=inv(Ab2CO); %Collect data into SAVDAT matrix clear savdat if loadon==0 for nn=1:K x1=get(fcns(nn),'XData'); cordat([1 3 5])=x1([2 3 4]); y1=get(fcns(nn),'YData'); cordat([2 4 6])=y1([2 3 4]); savdat(nn,:)=(CO2Ab*cordat')'; end end %Load frame ldsvbox(1) = uicontrol(Cpan,... 'Style','frame',... 'Position',[180 10 160 75]); LSpos=get(ldsvbox(1),'Position'); LSpos(3:4)=[0 0]; if loadon %Load static text ldsvbox(2) = uicontrol(Cpan,... 'Style','text',... 'Position',LSpos+[10 48 100 20],... 'String','Load...'); else %Save static text ldsvbox(2) = uicontrol(Cpan,... 'Style','text',... 'Position',LSpos+[5 48 115 20],... 'String','Save as...'); end %Cancel button ldsvbox(3) = uicontrol(Cpan,... 'Style','push',... 'Position',LSpos+[10 5 140 20],... 'String','Cancel',... 'Callback',['for nn=1:5,',... 'delete(ldsvbox(nn)),',... 'end,',... 'ctlmode=''on'';',... 'setwho=2;',... 'setctl,',... 'ldsvon=0;']); %Yes save button ldsvbox(4) = uicontrol(Cpan,... 'Style','push',... 'Position',LSpos+[125 50 30 20],... 'Visible','off',... 'String','Yes',... 'Callback',['eval([''save '',fname,'' savdat -ascii'']);',... 'for nn=1:5,',... 'delete(ldsvbox(nn)),',... 'end,',... 'ctlmode=''on'';',... 'setwho=2;',... 'setctl,',... 'ldsvon=0;']); %Load/Save editable text ldsvbox(5) = uicontrol(Cpan,... 'Style','edit',... 'Position',LSpos+[10 28 140 20],... 'CallBack',['fname=get(ldsvbox(5),''String'');',... 'eval([''clear '',fname]);'... 'fexis=0;',... 'if exist(fname)==2,',... 'fexis=1;',... 'end,',... 'if loadon,',... 'if fexis,',... 'eval([''load '',fname,'' -ascii'']);',... 'eval([''savdat='',fname,'';'']);',... 'for nn=1:K,',... 'delete(fcns(nn)),',... 'end,',... 'clear fcns,',... 'K=size(savdat);',... 'K=K(1);',... 'fcnon=ones(1,K);',... 'oldn=0;',... 'curdat(11)=-3;',... 'for n=1:K,',... 'axes(Gaxes),',... 'fcns(n)=line(0,0);',... 'curdat(1:6)=Ab2CO*savdat(n,:)'';',... 'updatecd,',... 'oldn=n;',... 'end,',... 'for nn=1:5,',... 'delete(ldsvbox(nn)),',... 'end,',... 'ctlmode=''on'';',... 'setwho=2;',... 'setctl,',... 'ldsvon=0;',... 'else,',... 'set(ldsvbox(2),''String'',''No such filename'','... '''Position'',LSpos+[5 48 150 20]);',... 'pause(3);',... 'set(ldsvbox(2),''String'',''Load...'','... '''Position'',LSpos+[10 48 100 20]);',... 'end,',... 'else,',... 'if fexis,',... 'set(ldsvbox(2),''String'','... '''Replace existing?'');',... 'set(ldsvbox(4),''Visible'',''on'');',... 'else,',... 'eval([''save '',fname,'' savdat -ascii'']);',... 'for nn=1:5,',... 'delete(ldsvbox(nn)),',... 'end,',... 'ctlmode=''on'';',... 'setwho=2;',... 'setctl,',... 'ldsvon=0;',... 'end,',... 'end']);