gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/fseriesexpogui.m
function varargout = fseriesexpogui(varargin) % This code is by Jim Squire <SquireJC@vmi.edu> % It needs to be recoded to SSUM format. % % FSERIESEXPOGUI M-file for fseriesexpogui.fig % FSERIESEXPOGUI, by itself, creates a new FSERIESEXPOGUI or raises the existing % singleton*. % % H = FSERIESEXPOGUI returns the handle to a new FSERIESEXPOGUI or the handle to % the existing singleton*. % % FSERIESEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in FSERIESEXPOGUI.M with the given input arguments. % % FSERIESEXPOGUI('Property','Value',...) creates a new FSERIESEXPOGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before fseriesexpogui_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to fseriesexpogui_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help fseriesexpogui % Last Modified by GUIDE v2.5 31-Mar-2005 18:06:31 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @fseriesexpogui_OpeningFcn, ... 'gui_OutputFcn', @fseriesexpogui_OutputFcn, ... 'gui_LayoutFcn', @fseriesexpogui_LayoutFcn, ... 'gui_Callback', []); if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before fseriesexpogui is made visible. function fseriesexpogui_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; guidata(hObject, handles); t=load('fseriespict.mat'); % Fig1 axes(handles.uiaxFig1); image(t.strGraphic.Fig1); set(handles.uiaxFig1,'Visible','Off') colormap([0 0 0;236 233 216]/255) % Fig2 axes(handles.uiaxFig2) image(t.strGraphic.Fig2) set(handles.uiaxFig2,'Visible','Off') % Fig3 axes(handles.uiaxFig3) image(t.strGraphic.Fig3) set(handles.uiaxFig3,'Visible','Off') % Calculate and fill the plots CalculateAndUpdate(handles) function varargout = fseriesexpogui_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output; %%%%%%%%%%%%%%%%%%%%%%%% Input function: wave type %%%%%%%%%%%%%%%%%%%%%%%%%%% function uirbWaveTypeSin_Callback(hObject, eventdata, handles) set(handles.uirbWaveTypeSin, 'Value', 1); set([handles.uirbWaveTypeSquare handles.uirbWaveTypeTriangle], 'Value', 0); CalculateAndUpdate(handles) function uirbWaveTypeSquare_Callback(hObject, eventdata, handles) set(handles.uirbWaveTypeSquare, 'Value', 1); set([handles.uirbWaveTypeSin handles.uirbWaveTypeTriangle], 'Value', 0); CalculateAndUpdate(handles) function uirbWaveTypeTriangle_Callback(hObject, eventdata, handles) set(handles.uirbWaveTypeTriangle, 'Value', 1); set([handles.uirbWaveTypeSin handles.uirbWaveTypeSquare], 'Value', 0); CalculateAndUpdate(handles) %%%%%%%%%%%%%%%%%%%%%%% Slider data %%%%%%%%%%%%%%%%%%%%%%%%% function uislFrequency_Callback(hObject, eventdata, handles) CalculateAndUpdate(handles) function uislAmplitude_Callback(hObject, eventdata, handles) CalculateAndUpdate(handles) function uislSymmetry_Callback(hObject, eventdata, handles) CalculateAndUpdate(handles) function uislYOffset_Callback(hObject, eventdata, handles) CalculateAndUpdate(handles) function uislTDelay_Callback(hObject, eventdata, handles) CalculateAndUpdate(handles) %%%%%%%%%%%%%%%%%%%%%%% Fourier series form %%%%%%%%%%%%%%%%%%%%%%%%% function uirbFig1_Callback(hObject, eventdata, handles) set(handles.uirbFig1, 'Value', 1) set([handles.uirbFig2 handles.uirbFig3], 'Value', 0); set(handles.uirbPlotComponent1,'String','ai') set(handles.uirbPlotComponent2,'String','bi') set([handles.uirbPlotComponent3 handles.uirbPlotComponent4],'Enable','off') if get(handles.uirbPlotComponent3,'Value') ||get(handles.uirbPlotComponent4,'Value') set([handles.uirbPlotComponent3 handles.uirbPlotComponent4],'Value',0) set(handles.uirbPlotComponent1,'Value',1) end CalculateAndUpdate(handles) function uirbFig2_Callback(hObject, eventdata, handles) set(handles.uirbFig2, 'Value', 1); set([handles.uirbFig1 handles.uirbFig3], 'Value', 0); set(handles.uirbPlotComponent1,'String','Ai') set(handles.uirbPlotComponent2,'String','Thetai') set([handles.uirbPlotComponent3 handles.uirbPlotComponent4],'Enable','off') if get(handles.uirbPlotComponent3,'Value') ||get(handles.uirbPlotComponent4,'Value') set([handles.uirbPlotComponent3 handles.uirbPlotComponent4],'Value',0) set(handles.uirbPlotComponent1,'Value',1) end CalculateAndUpdate(handles) function uirbFig3_Callback(hObject, eventdata, handles) set(handles.uirbFig3, 'Value', 1); set([handles.uirbFig1 handles.uirbFig2], 'Value', 0); set(handles.uirbPlotComponent1,'String','real{ci}') set(handles.uirbPlotComponent2,'String','imag{ci}') set([handles.uirbPlotComponent3 handles.uirbPlotComponent4],'Enable','on') CalculateAndUpdate(handles) %%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fourier Series: NumTerms %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function uislNumTerms_Callback(hObject, eventdata, handles) switch round(get(handles.uislNumTerms,'Value')) case 0, N = 0; case 1, N = 1; case 2, N = 2; case 3, N = 3; case 4, N = 4; case 5, N = 5; case 6, N = 6; case 7, N = 7; case 8, N = 8; case 9, N = 9; case 10, N = 10; case 11, N = 20; case 12, N = 30; case 13, N = 40; case 14, N = 50; case 15, N = 100; end set(handles.uitxNumTerms,'String',sprintf('N terms = %g',N)) CalculateAndUpdate(handles) %%%%%%%%%%%%%%%%%%%%%%%%%% Fourier Series: plot components %%%%%%%%%%%%%%%%%%%%%%%%%%%%% function uirbPlotComponent1_Callback(hObject, eventdata, handles) set(handles.uirbPlotComponent1, 'Value', 1); set([handles.uirbPlotComponent2 handles.uirbPlotComponent3 handles.uirbPlotComponent4], 'Value', 0); CalculateAndUpdate(handles) function uirbPlotComponent2_Callback(hObject, eventdata, handles) set(handles.uirbPlotComponent2, 'Value', 1); set([handles.uirbPlotComponent1 handles.uirbPlotComponent3 handles.uirbPlotComponent4], 'Value', 0); CalculateAndUpdate(handles) function uirbPlotComponent3_Callback(hObject, eventdata, handles) set(handles.uirbPlotComponent3, 'Value', 1); set([handles.uirbPlotComponent1 handles.uirbPlotComponent2 handles.uirbPlotComponent4], 'Value', 0); CalculateAndUpdate(handles) function uirbPlotComponent4_Callback(hObject, eventdata, handles) set(handles.uirbPlotComponent4, 'Value', 1); set([handles.uirbPlotComponent1 handles.uirbPlotComponent2 handles.uirbPlotComponent3], 'Value', 0); CalculateAndUpdate(handles) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CalculateAndUpdate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function CalculateAndUpdate(handles) strGui = GetGUIValues(handles); % get all the scaled date from the GUI % calculate strData.y0Time, .xTime, y1Time, xFreq, yFreq strData = CaculateSeries(strGui); % Display time axes(handles.uiaxTime) plot(strData.xTime,strData.y0Time,'r-',strData.xTime,strData.y1Time,'b-') xlabel('Time (s)') legend('Orignal','Reconstructed') v=axis; if v(4)-v(3)<1e-4 v(4)=v(4)+0.5; v(3)=v(3)-0.5; end axis(v) % Display freq axes(handles.uiaxFreq) stem('v6',strData.xFreq,strData.yFreq) xlabel('Freq (Hz)') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetGUIValues %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function strGui = GetGUIValues(handles) % Wave type t = get(handles.uirbWaveTypeSin,'Value') + 2*get(handles.uirbWaveTypeSquare,'Value') + 4*get(handles.uirbWaveTypeTriangle,'Value'); switch t case 1, strGui.waveType = 'Sin'; case 2, strGui.waveType = 'Square'; case 4, strGui.waveType = 'Triangle'; otherwise, error(sprintf('Unknown wave type: ',t)); end % Wave parameters strGui.w = ScaleIt(get(handles.uislFrequency,'Value'),0,4,8,0,2*pi,6*pi); % frequency in rads/s if ~strGui.w, strGui.w=1e-6; end T = 2*pi/strGui.w; strGui.A = ScaleIt(get(handles.uislAmplitude,'Value'),0,4,8,0,1,4); % amplitude strGui.sym = ScaleIt(round(get(handles.uislSymmetry,'Value')),0,4,8,1e-6,0.5-1e-6,1-1e-6); % symmetry strGui.yOff = ScaleIt(get(handles.uislYOffset,'Value'),0,4,8,-2,0,2); % yOffset strGui.tDelay = ScaleIt(get(handles.uislTDelay,'Value'),0,4,8,0,T/2,T); % tDelay % Fourier series form t = get(handles.uirbFig1,'Value') + 2*get(handles.uirbFig2,'Value') + 4*get(handles.uirbFig3,'Value'); switch t case 1, strGui.fourierForm = 'Quadrature'; case 2, strGui.fourierForm = 'Polar'; case 4, strGui.fourierForm = 'Exponential'; otherwise, error(sprintf('Unknown Fourier Form',t)); end % Num Terms sNTerms = get(handles.uitxNumTerms,'String'); sNTerms(1:10) = []; strGui.N = str2num(sNTerms); % Plot component ai, bi, etc. t = get(handles.uirbPlotComponent1,'Value') + 2*get(handles.uirbPlotComponent2,'Value') + 4*get(handles.uirbPlotComponent3,'Value') + 8*get(handles.uirbPlotComponent4,'Value'); switch t case 1, strGui.plotComponent = 1; case 2, strGui.plotComponent = 2; case 4, strGui.plotComponent = 3; case 8, strGui.plotComponent = 4; otherwise, error(sprintf('Unknown component type %g',t)) end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CaculateSeries %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function strData = CaculateSeries(strGui) % get GUI parameters waveType = strGui.waveType; w = strGui.w; T = 2*pi/w; A = strGui.A; sym = strGui.sym; yOff = strGui.yOff; tDelay = strGui.tDelay; fourierForm = strGui.fourierForm; N = strGui.N; plotComponent = strGui.plotComponent; %%%%%%%%%%%%%%%%%%%%%%%%%%% Calculate the time-domain vectors %%%%%%%%%%%%%%%%%%%%% % create output vectors t = linspace(0,2,400); y0 = zeros(size(t)); y1 = y0; % First create a triangle wave, regardless of what was requested T1 = T*sym; % Triangle changes direction at T1, which may be from 0 to T m1 = -2/T1; b1 = 1; % line equations for first part m2 = 2/(T-T1); b2 = 1-m2*T; tt = mod(t-tDelay,T) + tDelay; for i=1:length(t) if tDelay<=tt(i) && tt(i)<=T1+tDelay triangle(i) = m1*(tt(i)-tDelay) + b1; elseif T1+tDelay < tt(i) && tt(i) <= T+tDelay triangle(i) = m2*(tt(i)-tDelay) + b2; else error('Impossible time bracket') end end % Next change it into the requested type switch strGui.waveType case 'Sin' for i=1:length(y0) theta = (1-triangle)*pi/2; y0 = A*cos(theta) +yOff; end case 'Square' if sym<=1e-6, y0 = ones(size(triangle)); elseif sym>=1-1e-6 y0 = -ones(size(triangle)); else symOffset = (sym-1/2)*2; y0 = A*sign(triangle-symOffset) + yOff; end Ta = (m1*tDelay-b1+2*sym-1)/m1; Tb = (m2*tDelay-b2+2*sym-1)/m2; if w<=1e-6 Ta=0; Tb=0; end case 'Triangle' y0 = A*triangle + yOff; otherwise error('Unknown waveType') end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Calculate the c's %%%%%%%%%%%%%%%%%%%%%%%%%%%% % create vectors f = zeros(1,N+1); c = f; % determine c switch strGui.waveType case 'Sin' tt1=m1*m2*pi*T*yOff; tt2=m2*cos(b1*pi/2)-m1*cos(pi/2*(b2+m2*T)); tt3=-m2*cos(pi/2*(b1+m1*T1))+m1*cos(pi/2*(b2+m2*T1)); tt4=m1*m2*pi*T; c(1)=(tt1+2*A*(tt2+tt3))/tt4; if w<=1e-5 c(1)=y0(1); else for n=1:N tt1=-1/(n*T*w); tt2=pi/2; tt3=m1^2*pi^2-4*n^2*w^2; tt4=m2^2*pi^2-4*n^2*w^2; tt5=tt2*(b1+m1*T1); tt6=tt2*(b2+m2*T); tt7=tt2*(b2+m2*T1); tt8=j*m1*pi*cos(b1*tt2)-2*n*w*sin(b1*tt2); tt9=-j*m1*pi*cos(tt5)+exp(j*n*T1*w)*tt8+2*n*w*sin(tt5); tt10=-j*m2*pi*cos(tt6)+2*n*w*sin(tt6); tt11=j*m2*pi*tt3*cos(tt7)+tt4*tt9-2*n*w*tt3*sin(tt7); tt12=exp(-j*n*w*(T+tDelay))*yOff*(exp(j*n*T*w)-1); tt13=exp(j*n*w*(T1+2*tDelay))*tt3*tt10+exp(j*n*w*(T+2*tDelay))*tt11; tt14=2*A*n*w*tt13*exp(-j*n*w*(T+T1+3*tDelay)); c(n+1)=tt1*j*(tt14/(tt3*tt4)); end end case 'Triangle' if w<=1e-5 c(1)=y0(1); else c(1)=A*(m2*T^2+2*b2*(T-T1)+2*b1*T1+(m1-m2)*T1^2)/(2*T)+yOff; for n=1:N tt1=j*n*w; tt2=exp(-tt1*(T+T1+tDelay))/(n^2*T*w^2); tt3=-exp(tt1*(T+T1))*(m1+tt1*b1); tt4=exp(tt1*T1)*(m2+tt1*(b2+m2*T)); tt5=exp(tt1*T)*(m1-m2+tt1*(b1-b2+m1*T1-m2*T1)); tt6=-tt1*exp(tt1*T1)*(exp(tt1*T)-1)*yOff; c(n+1)=tt2*(A*(tt3+tt4+tt5)+tt6); end end case 'Square' c(1)=A*(T+2*(Ta-Tb))/T+yOff; % this is really c0 for n=1:N tt1=j*n*w; tt2=j*exp(-tt1*(T+2*Ta+Tb))/(n*T*w); tt3=-2*A*exp(tt1*(T+2*Ta)); tt4=A*exp(tt1*(Ta+Tb)); tt5=(A-yOff)*exp(tt1*(T+Ta+Tb)); tt6=yOff*exp(tt1*(Ta+Tb)); c(n+1)=tt2*(tt3+tt4+tt5+tt6); end otherwise error('unknown waveType') end % if elements approximately zero, make exactly zero for n=1:N+1 if abs(real(c(n)))<=1e-5 c(n)=j*imag(c(n)); end if abs(imag(c(n)))<=1e-5 c(n)=real(c(n)); end end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Synthesize f(t) %%%%%%%%%%%%%%%%%%%%%%%%%%%% y1=y1+c(1); for n=1:N y1=y1 + c(n+1)*exp(j*n*w*t) + conj(c(n+1))*exp(-j*n*w*t); end switch fourierForm case 'Quadrature' switch plotComponent case 1 %an yFreq=2*real(c); case 2 %bn yFreq=2*imag(c); yFreq(1)=0; otherwise error('bad plotComponent combination') end case 'Polar' switch plotComponent case 1 %An yFreq=2*abs(c); case 2 %theta yFreq=angle(c)*180/pi; otherwise error('bad plotComponent combination') end case 'Exponential' switch plotComponent case 1 %real yFreq=real(c); case 2 %imag yFreq=imag(c); case 3 %mag yFreq=abs(c); case 4 %angle yFreq=angle(c)*180/pi; otherwise error('bad plotComponent combination') end end if w<=1e-6 xFreq=zeros(size(c)); else xFreq= linspace(0,N*w/(2*pi),N+1); end %%%%%%%%%%%%%%%%%%%%%%%%%%% Fill up output structure %%%%%%%%%%%%%%%%%%%%%% strData.xTime = t; strData.y0Time = y0; strData.y1Time = y1; strData.xFreq = xFreq; strData.yFreq = yFreq; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ScaleIt %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function out=ScaleIt(sliderIn,sliderMin,sliderMean,sliderMax,outMin,outMean,outMax) % ScaleIt provides a piecewise scaling of value SliderIn % if SliderIn is between sliderMin and SliderMean it is scaled between outMin and outMean % and similarly betwen Mean and Max if sliderIn<sliderMin || sliderIn > sliderMax error('slider in outside min/max boundaries in ScaleIt') end if sliderIn < sliderMean tm = (outMean-outMin)/(sliderMean-sliderMin); else tm = (outMax-outMean)/(sliderMax-sliderMean); end tb = outMean - (sliderMean * tm); out = sliderIn * tm + tb; % --- Creates and returns a handle to the GUI figure. function h1 = fseriesexpogui_LayoutFcn(policy) % policy - create a new figure or use a singleton. 'new' or 'reuse'. persistent hsingleton; if strcmpi(policy, 'reuse') & ishandle(hsingleton) h1 = hsingleton; return; end appdata = []; appdata.GUIDEOptions = struct(... 'active_h', [], ... 'taginfo', struct(... 'figure', 2, ... 'text', 34, ... 'axes', 8, ... 'checkbox', 2, ... 'frame', 11, ... 'radiobutton', 15, ... 'slider', 8, ... 'popupmenu', 2, ... 'pushbutton', 2, ... 'uipanel', 3), ... 'override', 0, ... 'release', 13, ... 'resize', 'none', ... 'accessibility', 'callback', ... 'mfile', 1, ... 'callbacks', 1, ... 'singleton', 1, ... 'syscolorfig', 1, ... 'lastSavedFile', '/Users/bobsturm/SSUM/fseriesexpogui.m', ... 'blocking', 0); appdata.lastValidTag = 'fseries_fig'; appdata.GUIDELayoutEditor = []; h1 = figure(... 'Color',[0.701960784313725 0.701960784313725 0.701960784313725],... 'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],... 'DockControls','off',... 'IntegerHandle','off',... 'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),... 'MenuBar','none',... 'Name','Fourier Series Explorer',... 'NumberTitle','off',... 'PaperPosition',get(0,'defaultfigurePaperPosition'),... 'Position',[520 243.000000000001 846 557],... 'Renderer',get(0,'defaultfigureRenderer'),... 'RendererMode','manual',... 'Resize','off',... 'HandleVisibility','callback',... 'Tag','fseries_fig',... 'UserData',[],... 'Behavior',get(0,'defaultfigureBehavior'),... 'Visible','on',... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uiaxTime'; h2 = axes(... 'Parent',h1,... 'Units','pixels',... 'Position',[415 337 399 172],... 'Box','on',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'FontSize',8,... 'LooseInset',[109.98 61.27 80.37 41.775],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','uiaxTime',... 'Behavior',get(0,'defaultaxesBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); h3 = get(h2,'title'); set(h3,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.5 1.02616279069767 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h4 = get(h2,'xlabel'); set(h4,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.497493734335839 -0.107558139534884 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','cap',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h5 = get(h2,'ylabel'); set(h5,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.0513784461152883 0.491279069767442 1.00005459937205],... 'Rotation',90,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h6 = get(h2,'zlabel'); set(h6,... 'Parent',h2,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','right',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-1.03884711779449 1.27616279069767 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','middle',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','off',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); appdata = []; appdata.lastValidTag = 'uiaxFreq'; h7 = axes(... 'Parent',h1,... 'Units','pixels',... 'Position',[415 87 399 172],... 'Box','on',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'FontSize',8,... 'LooseInset',[109.98 61.27 80.37 41.775],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','uiaxFreq',... 'Behavior',get(0,'defaultaxesBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); h8 = get(h7,'title'); set(h8,... 'Parent',h7,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.5 1.0203488372093 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h9 = get(h7,'xlabel'); set(h9,... 'Parent',h7,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.497493734335839 -0.107558139534884 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','cap',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h10 = get(h7,'ylabel'); set(h10,... 'Parent',h7,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.0513784461152883 0.491279069767442 1.00005459937205],... 'Rotation',90,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h11 = get(h7,'zlabel'); set(h11,... 'Parent',h7,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','right',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-1.03884711779449 2.7296511627907 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','middle',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','off',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); appdata = []; appdata.lastValidTag = 'text1'; h12 = uicontrol(... 'Parent',h1,... 'BackgroundColor',[0.701961 0.701961 0.701961],... 'FontName','Arial',... 'FontSize',16,... 'FontWeight','bold',... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[656 1035 140 30],... 'String',{ 'Specify Filter'; ' ' },... 'Style','text',... 'Tag','text1',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text2'; h13 = uicontrol(... 'Parent',h1,... 'FontName','Arial',... 'FontSize',12,... 'FontWeight','bold',... 'ListboxTop',0,... 'Position',[503 512 250 20],... 'String','f(t): Time Domain Synthesis',... 'Style','text',... 'HitTest','off',... 'Tag','text2',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text5'; h14 = uicontrol(... 'Parent',h1,... 'FontName','Arial',... 'FontSize',12,... 'FontWeight','bold',... 'ListboxTop',0,... 'Position',[493 262 280 20],... 'String','F(jw): Fourier Series Decomposition',... 'Style','text',... 'HitTest','off',... 'Tag','text5',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbWaveTypeSin'; h15 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbWaveTypeSin_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[79 489 65 15],... 'String','cos',... 'Style','radiobutton',... 'Tag','uirbWaveTypeSin',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbWaveTypeSquare'; h16 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbWaveTypeSquare_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[157 488 65 15],... 'String','square',... 'Style','radiobutton',... 'Value',1,... 'Tag','uirbWaveTypeSquare',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbWaveTypeTriangle'; h17 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbWaveTypeTriangle_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[237 488 65 15],... 'String','triangle',... 'Style','radiobutton',... 'Tag','uirbWaveTypeTriangle',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text7'; h18 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[37 444 55 20],... 'String','frequency',... 'Style','text',... 'Tag','text7',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uislFrequency'; h19 = uicontrol(... 'Parent',h1,... 'BackgroundColor',[0.701961 0.701961 0.701961],... 'Callback','fseriesexpogui(''uislFrequency_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Max',8,... 'Position',[141 446 173 20],... 'String',{ '' },... 'Style','slider',... 'SliderStep',[0.125 0.125],... 'Value',4,... 'Tag','uislFrequency',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text10'; h20 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[113 444 25 20],... 'String','zero',... 'Style','text',... 'Tag','text10',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text11'; h21 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[317 444 25 20],... 'String','max',... 'Style','text',... 'Tag','text11',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text12'; h22 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[37 416 55 20],... 'String','amplitude',... 'Style','text',... 'Tag','text12',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uislAmplitude'; h23 = uicontrol(... 'Parent',h1,... 'BackgroundColor',[0.701961 0.701961 0.701961],... 'Callback','fseriesexpogui(''uislAmplitude_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Max',8,... 'Position',[140 418 173 20],... 'String',{ '' },... 'Style','slider',... 'SliderStep',[0.125 0.125],... 'Value',4,... 'Tag','uislAmplitude',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text13'; h24 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[113 416 25 20],... 'String','zero',... 'Style','text',... 'Tag','text13',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text14'; h25 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[317 416 25 20],... 'String','max',... 'Style','text',... 'Tag','text14',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text16'; h26 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[37 388 55 20],... 'String','symmetry',... 'Style','text',... 'Tag','text16',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uislSymmetry'; h27 = uicontrol(... 'Parent',h1,... 'BackgroundColor',[0.701961 0.701961 0.701961],... 'Callback','fseriesexpogui(''uislSymmetry_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Max',8,... 'Position',[140 390 173 20],... 'String',{ '' },... 'Style','slider',... 'SliderStep',[0.125 0.125],... 'Value',4,... 'Tag','uislSymmetry',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text17'; h28 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[113 388 25 20],... 'String','left',... 'Style','text',... 'Tag','text17',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text18'; h29 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[317 388 25 20],... 'String','right',... 'Style','text',... 'Tag','text18',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text19'; h30 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[37 360 55 20],... 'String','y offset',... 'Style','text',... 'Tag','text19',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uislYOffset'; h31 = uicontrol(... 'Parent',h1,... 'BackgroundColor',[0.701961 0.701961 0.701961],... 'Callback','fseriesexpogui(''uislYOffset_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Max',8,... 'Position',[140 362 173 20],... 'String',{ '' },... 'Style','slider',... 'SliderStep',[0.125 0.125],... 'Value',4,... 'Tag','uislYOffset',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text20'; h32 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[113 360 25 20],... 'String','neg',... 'Style','text',... 'Tag','text20',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text21'; h33 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[317 360 25 20],... 'String','pos',... 'Style','text',... 'Tag','text21',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text23'; h34 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[37 332 55 20],... 'String','t delay',... 'Style','text',... 'Tag','text23',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uislTDelay'; h35 = uicontrol(... 'Parent',h1,... 'BackgroundColor',[0.701961 0.701961 0.701961],... 'Callback','fseriesexpogui(''uislTDelay_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Max',8,... 'Position',[140 334 173 20],... 'String',{ '' },... 'Style','slider',... 'SliderStep',[0.125 0.125],... 'Tag','uislTDelay',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text24'; h36 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[113 332 25 20],... 'String','zero',... 'Style','text',... 'Tag','text24',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uiaxFig1'; h37 = axes(... 'Parent',h1,... 'Units','pixels',... 'Position',[69 231 272 45],... 'ALim',get(0,'defaultaxesALim'),... 'ALimMode','manual',... 'AmbientLightColor',[0.925490196078431 0.913725490196078 0.847058823529412],... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode','manual',... 'CameraTarget',[0.5 0.5 0.5],... 'CameraTargetMode','manual',... 'CameraUpVector',[0 1 0],... 'CameraUpVectorMode','manual',... 'CameraViewAngle',6.60861036031192,... 'CameraViewAngleMode','manual',... 'CLim',get(0,'defaultaxesCLim'),... 'CLimMode','manual',... 'Color',[0.925490196078431 0.913725490196078 0.847058823529412],... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'DataAspectRatio',get(0,'defaultaxesDataAspectRatio'),... 'DataAspectRatioMode','manual',... 'FontSize',8,... 'LooseInset',[109.98 61.27 80.37 41.775],... 'PlotBoxAspectRatio',get(0,'defaultaxesPlotBoxAspectRatio'),... 'PlotBoxAspectRatioMode','manual',... 'TickLength',[0 0],... 'TickDir',get(0,'defaultaxesTickDir'),... 'TickDirMode','manual',... 'XColor',[0.925490196078431 0.913725490196078 0.847058823529412],... 'XLim',get(0,'defaultaxesXLim'),... 'XLimMode','manual',... 'XTick',[],... 'XTickLabel','',... 'XTickLabelMode','manual',... 'XTickMode','manual',... 'YColor',[0.925490196078431 0.913725490196078 0.847058823529412],... 'YLim',get(0,'defaultaxesYLim'),... 'YLimMode','manual',... 'YTick',[],... 'YTickLabel','',... 'YTickLabelMode','manual',... 'YTickMode','manual',... 'ZColor',[0.925490196078431 0.913725490196078 0.847058823529412],... 'ZLim',get(0,'defaultaxesZLim'),... 'ZLimMode','manual',... 'ZTick',[0 0.5 1],... 'ZTickLabel','',... 'ZTickLabelMode','manual',... 'ZTickMode','manual',... 'Tag','uiaxFig1',... 'UserData',[],... 'Behavior',get(0,'defaultaxesBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); h38 = get(h37,'title'); set(h38,... 'Parent',h37,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.488888888888889 1.07777777777778 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h39 = get(h37,'xlabel'); set(h39,... 'Parent',h37,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0.925490196078431 0.913725490196078 0.847058823529412],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.488888888888889 -0.166666666666666 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','cap',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h40 = get(h37,'ylabel'); set(h40,... 'Parent',h37,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0.925490196078431 0.913725490196078 0.847058823529412],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.133333333333333 0.477777777777778 1.00005459937205],... 'Rotation',90,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h41 = get(h37,'zlabel'); set(h41,... 'Parent',h37,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0.925490196078431 0.913725490196078 0.847058823529412],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','right',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-4.04444444444444 7.23333333333333 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','middle',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','off',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); appdata = []; appdata.lastValidTag = 'text25'; h42 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[317 332 25 20],... 'String','max',... 'Style','text',... 'Tag','text25',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbFig2'; h43 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbFig2_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[51 202 15 15],... 'String','',... 'Style','radiobutton',... 'Tag','uirbFig2',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uiaxFig2'; h44 = axes(... 'Parent',h1,... 'Units','pixels',... 'Position',[69 187 272 45],... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',[0.925490196078431 0.913725490196078 0.847058823529412],... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'FontSize',8,... 'LooseInset',[109.98 61.27 80.37 41.775],... 'TickLength',[0 0],... 'XColor',[1 1 1],... 'XTick',[],... 'XTickMode','manual',... 'YColor',[1 1 1],... 'YTick',[],... 'YTickMode','manual',... 'ZColor',[1 1 1],... 'Tag','uiaxFig2',... 'Behavior',get(0,'defaultaxesBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); h45 = get(h44,'title'); set(h45,... 'Parent',h44,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.498161764705882 1.07777777777778 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h46 = get(h44,'xlabel'); set(h46,... 'Parent',h44,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[1 1 1],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.498161764705882 -0.166666666666668 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','cap',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h47 = get(h44,'ylabel'); set(h47,... 'Parent',h44,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[1 1 1],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.0202205882352941 0.477777777777777 1.00005459937205],... 'Rotation',90,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h48 = get(h44,'zlabel'); set(h48,... 'Parent',h44,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[1 1 1],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','right',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.251838235294118 8.21111111111111 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','middle',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','off',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); appdata = []; appdata.lastValidTag = 'uiaxFig3'; h49 = axes(... 'Parent',h1,... 'Units','pixels',... 'Position',[69 143 272 45],... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',[0.925490196078431 0.913725490196078 0.847058823529412],... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'FontSize',8,... 'LooseInset',[109.98 61.27 80.37 41.775],... 'TickLength',[0 0],... 'XColor',[1 1 1],... 'XTick',[],... 'XTickMode','manual',... 'YColor',[1 1 1],... 'YTick',[],... 'YTickMode','manual',... 'ZColor',[1 1 1],... 'Tag','uiaxFig3',... 'Behavior',get(0,'defaultaxesBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); h50 = get(h49,'title'); set(h50,... 'Parent',h49,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[0 0 0],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.498161764705882 1.07777777777778 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h51 = get(h49,'xlabel'); set(h51,... 'Parent',h49,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[1 1 1],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[0.498161764705882 -0.166666666666668 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','cap',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h52 = get(h49,'ylabel'); set(h52,... 'Parent',h49,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[1 1 1],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','center',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.0202205882352941 0.477777777777776 1.00005459937205],... 'Rotation',90,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','bottom',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','on',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); h53 = get(h49,'zlabel'); set(h53,... 'Parent',h49,... 'Units','data',... 'FontUnits','points',... 'BackgroundColor','none',... 'Color',[1 1 1],... 'EdgeColor','none',... 'EraseMode','normal',... 'DVIMode','auto',... 'FontAngle','normal',... 'FontName','Helvetica',... 'FontSize',8,... 'FontWeight','normal',... 'HorizontalAlignment','right',... 'LineStyle','-',... 'LineWidth',0.5,... 'Margin',2,... 'Position',[-0.251838235294118 9.18888888888889 1.00005459937205],... 'Rotation',0,... 'String','',... 'Interpreter','tex',... 'VerticalAlignment','middle',... 'ButtonDownFcn',[],... 'CreateFcn', {@local_CreateFcn, [], ''} ,... 'DeleteFcn',[],... 'BusyAction','queue',... 'HandleVisibility','off',... 'HelpTopicKey','',... 'HitTest','on',... 'Interruptible','on',... 'SelectionHighlight','on',... 'Serializable','on',... 'Tag','',... 'UserData',[],... 'Behavior',struct(),... 'Visible','off',... 'XLimInclude','on',... 'YLimInclude','on',... 'ZLimInclude','on',... 'CLimInclude','on',... 'ALimInclude','on',... 'Clipping','off'); appdata = []; appdata.lastValidTag = 'uirbFig1'; h54 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbFig1_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[51 247 18 15],... 'String','',... 'Style','radiobutton',... 'Value',1,... 'Tag','uirbFig1',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbFig3'; h55 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbFig3_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[51 158 15 15],... 'String','',... 'Style','radiobutton',... 'Tag','uirbFig3',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbPlotComponent1'; h56 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbPlotComponent1_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[80 80 60 15],... 'String','ai',... 'Style','radiobutton',... 'Value',1,... 'Tag','uirbPlotComponent1',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbPlotComponent2'; h57 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbPlotComponent2_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[145 80 60 15],... 'String','bi',... 'Style','radiobutton',... 'Tag','uirbPlotComponent2',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbPlotComponent3'; h58 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbPlotComponent3_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','off',... 'ListboxTop',0,... 'Position',[210 80 45 15],... 'String','| ci |',... 'Style','radiobutton',... 'Tag','uirbPlotComponent3',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uirbPlotComponent4'; h59 = uicontrol(... 'Parent',h1,... 'Callback','fseriesexpogui(''uirbPlotComponent4_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','off',... 'ListboxTop',0,... 'Position',[277 80 65 15],... 'String','angle{ci}',... 'Style','radiobutton',... 'Tag','uirbPlotComponent4',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uitxNumTerms'; h60 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[47 106 75 20],... 'String','N terms = 3',... 'Style','text',... 'Tag','uitxNumTerms',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uislNumTerms'; h61 = uicontrol(... 'Parent',h1,... 'BackgroundColor',[0.701961 0.701961 0.701961],... 'Callback','fseriesexpogui(''uislNumTerms_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Max',15,... 'Position',[121 108 221 20],... 'String',{ '' },... 'Style','slider',... 'SliderStep',[0.0666666666666667 0.0666666666666667],... 'Value',3,... 'Tag','uislNumTerms',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'text33'; h62 = uicontrol(... 'Parent',h1,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[47 80 20 15],... 'String','Plot',... 'Style','text',... 'Tag','text33',... 'Behavior',get(0,'defaultuicontrolBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uipanel2'; h63 = uipanel(... 'Parent',h1,... 'Units','pixels',... 'Title','Fourier Series',... 'Position',[20 70 330 225],... 'Tag','uipanel2',... 'Behavior',get(0,'defaultuipanelBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); appdata = []; appdata.lastValidTag = 'uipanel1'; h64 = uipanel(... 'Parent',h1,... 'Units','pixels',... 'Title','Input Function',... 'Position',[20 312 330 218],... 'Tag','uipanel1',... 'Behavior',get(0,'defaultuipanelBehavior'),... 'CreateFcn', {@local_CreateFcn, '', appdata} ); hsingleton = h1; % --- Set application data first then calling the CreateFcn. function local_CreateFcn(hObject, eventdata, createfcn, appdata) if ~isempty(appdata) names = fieldnames(appdata); for i=1:length(names) name = char(names(i)); setappdata(hObject, name, getfield(appdata,name)); end end if ~isempty(createfcn) eval(createfcn); end % --- Handles default GUIDE GUI creation and callback dispatch function varargout = gui_mainfcn(gui_State, varargin) gui_StateFields = {'gui_Name' 'gui_Singleton' 'gui_OpeningFcn' 'gui_OutputFcn' 'gui_LayoutFcn' 'gui_Callback'}; gui_Mfile = ''; for i=1:length(gui_StateFields) if ~isfield(gui_State, gui_StateFields{i}) error('Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile); elseif isequal(gui_StateFields{i}, 'gui_Name') gui_Mfile = [gui_State.(gui_StateFields{i}), '.m']; end end numargin = length(varargin); if numargin == 0 % FSERIESEXPOGUI % create the GUI gui_Create = 1; elseif isequal(ishandle(varargin{1}), 1) && ispc && iscom(varargin{1}) && isequal(varargin{1},gcbo) % FSERIESEXPOGUI(ACTIVEX,...) vin{1} = gui_State.gui_Name; vin{2} = [get(varargin{1}.Peer, 'Tag'), '_', varargin{end}]; vin{3} = varargin{1}; vin{4} = varargin{end-1}; vin{5} = guidata(varargin{1}.Peer); feval(vin{:}); return; elseif ischar(varargin{1}) && numargin>1 && isequal(ishandle(varargin{2}), 1) % FSERIESEXPOGUI('CALLBACK',hObject,eventData,handles,...) gui_Create = 0; else % FSERIESEXPOGUI(...) % create the GUI and hand varargin to the openingfcn gui_Create = 1; end if gui_Create == 0 varargin{1} = gui_State.gui_Callback; if nargout [varargout{1:nargout}] = feval(varargin{:}); else feval(varargin{:}); end else if gui_State.gui_Singleton gui_SingletonOpt = 'reuse'; else gui_SingletonOpt = 'new'; end % Open fig file with stored settings. Note: This executes all component % specific CreateFunctions with an empty HANDLES structure. % Do feval on layout code in m-file if it exists if ~isempty(gui_State.gui_LayoutFcn) gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt); % openfig (called by local_openfig below) does this for guis without % the LayoutFcn. Be sure to do it here so guis show up on screen. movegui(gui_hFigure,'onscreen') else gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); % If the figure has InGUIInitialization it was not completely created % on the last pass. Delete this handle and try again. if isappdata(gui_hFigure, 'InGUIInitialization') delete(gui_hFigure); gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); end end % Set flag to indicate starting GUI initialization setappdata(gui_hFigure,'InGUIInitialization',1); % Fetch GUIDE Application options gui_Options = getappdata(gui_hFigure,'GUIDEOptions'); if ~isappdata(gui_hFigure,'GUIOnScreen') % Adjust background color if gui_Options.syscolorfig set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor')); end % Generate HANDLES structure and store with GUIDATA guidata(gui_hFigure, guihandles(gui_hFigure)); end % If user specified 'Visible','off' in p/v pairs, don't make the figure % visible. gui_MakeVisible = 1; for ind=1:2:length(varargin) if length(varargin) == ind break; end len1 = min(length('visible'),length(varargin{ind})); len2 = min(length('off'),length(varargin{ind+1})); if ischar(varargin{ind}) && ischar(varargin{ind+1}) && ... strncmpi(varargin{ind},'visible',len1) && len2 > 1 if strncmpi(varargin{ind+1},'off',len2) gui_MakeVisible = 0; elseif strncmpi(varargin{ind+1},'on',len2) gui_MakeVisible = 1; end end end % Check for figure param value pairs for index=1:2:length(varargin) if length(varargin) == index || ~ischar(varargin{index}) break; end try set(gui_hFigure, varargin{index}, varargin{index+1}), catch break, end end % If handle visibility is set to 'callback', turn it on until finished % with OpeningFcn gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:}); if ishandle(gui_hFigure) % Update handle visibility set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); % Make figure visible if gui_MakeVisible set(gui_hFigure, 'Visible', 'on') if gui_Options.singleton setappdata(gui_hFigure,'GUIOnScreen', 1); end end % Done with GUI initialization rmappdata(gui_hFigure,'InGUIInitialization'); end % If handle visibility is set to 'callback', turn it on until finished with % OutputFcn if ishandle(gui_hFigure) gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end gui_Handles = guidata(gui_hFigure); else gui_Handles = []; end if nargout [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); else feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); end if ishandle(gui_hFigure) set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); end end function gui_hFigure = local_openfig(name, singleton) % openfig with three arguments was new from R13. Try to call that first, if % failed, try the old openfig. try gui_hFigure = openfig(name, singleton, 'auto'); catch % OPENFIG did not accept 3rd input argument until R13, % toggle default figure visible to prevent the figure % from showing up too soon. gui_OldDefaultVisible = get(0,'defaultFigureVisible'); set(0,'defaultFigureVisible','off'); gui_hFigure = openfig(name, singleton); set(0,'defaultFigureVisible',gui_OldDefaultVisible); end