function GSC2DConversions_aux(slide)
% Helper function for GSC2DConversions

%   Copyright 1986-2004 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $  $Date: 2004/08/17 21:33:03 $



clf;
p = localParameters;
%---Slides
ax = gca;
set(ax,'XLim',[2 8],'YLim',[0 11],'Visible','off');
set(get(ax,'parent'),'Position',[360   653   600   271]);% 696 350])


switch slide
    case 1        
        text('Parent',ax,'String','Continuous / Discrete Conversions','Position',[5 10],...
            'FontSize',p.fs3,'FontWeight',p.fw3,'Hor','center','Ver','middle');
        x11 = 1.5; x12 = 4.0;
        x21 = 6.0; x22 = 8.5;
        y11 = 2.5; y12 = 7.5;
        sysblock('Par',ax,'Pos',[x11 y11 x12-x11 y12-y11],'Name','continuous time',...
            'Num',' ','FaceColor',p.cc3,'FontSize',p.fs2,'FontWeight',p.fw1);
        sysblock('Par',ax,'Pos',[x21 y11 x22-x21 y12-y11],'Name','discrete time',...
            'Num',' ','FaceColor',p.cc2,'FontSize',p.fs2,'FontWeight',p.fw1);
        wire('Par',ax,'XData',[x12+.1 x21-.1],'YData',[y12-1.5 y12-1.5],'Arrow',.4);
        wire('Par',ax,'XData',[x21-.1 x12+.1],'YData',[y11+1.5 y11+1.5],'Arrow',.4);
        xd = x11+.15:.05:x12-.15;
        yd = (y11+y12)/2+1.4*sin(2*xd+1.3);
        [xds,yds] = stairs(xd(1:3:end)+x21-x11,yd(1:3:end));
        wire('Par',ax,'XData',xd,'YData',yd,'Color','r');
        wire('Par',ax,'XData',xds,'YData',yds,'Color','b');

    case 2
        text('Parent',ax,'String','Continuous / Discrete Conversions','Position',[5 10],...
            'FontSize',p.fs3,'FontWeight',p.fw3,'Hor','center','Ver','middle');
        x11 = 1.5; x12 = 4.0;
        x21 = 6.0; x22 = 8.5;
        y11 = 2.5; y12 = 7.5;
        sysblock('Par',ax,'Pos',[x11 y11 x12-x11 y12-y11],'Name',{'continuous-time','model'},'Num','sysc',...
            'FaceColor',p.cc3,'FontSize',p.fs3,'FontWeight',p.fw3,'NameFontSize',p.fs2,'NameFontWeight',p.fw1);
        sysblock('Par',ax,'Pos',[x21 y11 x22-x21 y12-y11],'Name',{'discrete-time','model'},'Num','sysd',...
            'FaceColor',p.cc2,'FontSize',p.fs3,'FontWeight',p.fw3,'NameFontSize',p.fs2,'NameFontWeight',p.fw1);
        wire('Par',ax,'XData',[x12+.1 x21-.1],'YData',[y12-1.5 y12-1.5],'Arrow',.4);
        wire('Par',ax,'XData',[x21-.1 x12+.1],'YData',[y11+1.5 y11+1.5],'Arrow',.4);
        text('Parent',ax,'String','c2d','Position',[5 y12-1.5+.3],'Color',[.8 0 0],...
            'FontSize',p.fs3,'FontWeight',p.fw3,'Hor','center','Ver','bottom');
        text('Parent',ax,'String','d2c','Position',[5 y11+1.5-.3],'Color',[.8 0 0],...
            'FontSize',p.fs3,'FontWeight',p.fw3,'Hor','center','Ver','top');
    case 3
        set(get(ax,'parent'),'Position',[360   653  696 350])
end


%%%%%%%%%%%%%%%%%%%
% localParameters %
%%%%%%%%%%%%%%%%%%%
function p_out = localParameters
%---Parameters/systems used in demo
persistent p;
if isempty(p)
    if ispc
        p.fs1 = 8;
        p.fs2 = 10;
        p.fs3 = 12;
    else
        p.fs1 = 10;
        p.fs2 = 12;
        p.fs3 = 14;
    end
    axBorder = 0.09;
    p.axpos1 = [axBorder 0.55 1-axBorder-.04 0.41];
    p.axpos2 = [0 0.45 1 0.55];
    p.fw1 = 'normal';
    p.fw2 = 'bold';
    p.fw3 = 'bold';
    p.as = .05;  %---Arrow size
    p.sbr = .04; %---Sumblock radius
    p.s = tf('s');
    p.cc1 = [1 1 .9];
    p.cc2 = [.9 1 1];
    p.cc3 = [1 .9 1];
    p.cc4 = [.9 1 .9];
    p.cc5 = [.9 .9 1];
    p.cc6 = [1 .9 .9];
    p.ccg = [.4 .4 .4];
end
p_out = p;