⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plt_prf.m

📁 基于MATLAB的辅助设计 简述了矩阵分析的重要性
💻 M
字号:
%
% ANALYSIS is the m-file which generate the input menus
% for all the analysis options.

%    Author:  Ole Barup Sorensen, Rapid Data Ltd 

%    Copyright (c) 1989-94 by Rapid Data Ltd
%    Revision 10:01  07/01/94

okflag=figflag('Plot preferences',0);

if okflag==0,									
  x=20;y=0;w=297;h=20;
  Sx=320;Sy=200;
  Fig11=figure('Numbertitle','off','Name','Plot preferences','Menubar','none',...
  'Units','normal','Position',[(160)/Scx (200)/Scy (320)/Scx (200)/Scy],'Nextplot',...
  'new','Resize','on','Color',[0.5 0.5 0.5]);

call = ['han = get(Fig11,''CurrentObject'');',...
        'if (get(han,''Value'') == 1),',...
           'set(get(han,''UserData''),''Value'',0),',...
        'else,'...
           'set(han,''Value'',1),',...
        'end;'];

if an_type==1,
  Han_In1(3)=uicontrol(Fig11,'Style','frame','Position',[(x-5)/Sx (135)/Sy (295)/Sx (50)/Sy]);
  Han_In1(1)=uicontrol(Fig11,'Style','radio','String','Exact bode diagram alone',...
  'Position',[(x)/Sx (160)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  Han_In1(2)=uicontrol(Fig11,'Style','radio','String','Both exact and asymptotic bode diagram',...
  'Position',[(x)/Sx (140)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  drawnow
  Han_In2(4)=uicontrol(Fig11,'Style','frame','Position',[(x-5)/Sx (55)/Sy (295)/Sx (70)/Sy]);
  Han_In2(1)=uicontrol(Fig11,'Style','radio','String','Plot both magnitude and phase',...
  'Position',[(x)/Sx (100)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  Han_In2(2)=uicontrol(Fig11,'Style','radio','String','Plot the magnitude',...
  'Position',[(x)/Sx (80)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  Han_In2(3)=uicontrol(Fig11,'Style','radio','String','Plot the phase',...
  'Position',[(x)/Sx (60)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  drawnow  

  for i = 1:2,
    set(Han_In1(i),'UserData',Han_In1(:,[1:(i-1),(i+1):2]))
  end
  for i = 1:3,  
    set(Han_In2(i),'UserData',Han_In2(:,[1:(i-1),(i+1):3]))
  end

  set(Han_In1(1),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ipp = 1;end;']);
  set(Han_In1(2),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ipp = 2;end;']);

  set(Han_In2(1),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'choice = 1;end;']);
  set(Han_In2(2),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'choice = 2;end;']);
  set(Han_In2(3),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'choice = 3;end;']);

  if ipp==1,
    set(Han_In1(1),'Value',1);
  elseif ipp==2,
    set(Han_In1(2),'Value',1);
  end

  if choice==1,
    set(Han_In2(1),'Value',1);
  elseif choice==2,
    set(Han_In2(2),'Value',1);
  elseif choice==3,
    set(Han_In2(3),'Value',1);
  end

elseif an_type==2,
  Han_In2(4)=uicontrol(Fig11,'Style','frame','Position',[(x-5)/Sx (55)/Sy (295)/Sx (70)/Sy]);
  Han_In2(1)=uicontrol(Fig11,'Style','radio','String','Ordinary Nyquist plot alone',...
  'Position',[(x)/Sx (100)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  Han_In2(2)=uicontrol(Fig11,'Style','radio','String','ATAN Nyquist plot alone',...
  'Position',[(x)/Sx (80)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  Han_In2(3)=uicontrol(Fig11,'Style','radio','String','Both ordinary and ATAN Nyquist plot',...
  'Position',[(x)/Sx (60)/Sy (w-15)/Sx (h)/Sy],'Value',0);
  
  for i = 1:3,  
  set(Han_In2(i),'UserData',Han_In2(:,[1:(i-1),(i+1):3]))
  end

  set(Han_In2(1),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ip = 1;end;']);
  set(Han_In2(2),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ip = 2;end;']);
  set(Han_In2(3),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ip = 3;end;']);

  if ip==1,
    set(Han_In2(1),'Value',1);
  elseif ip==2,
    set(Han_In2(2),'Value',1);
  elseif ip==3,
    set(Han_In2(3),'Value',1);
  end

elseif ((an_type==6)|(an_type==7)),

  Han_In1(4)=uicontrol(Fig11,'Style','frame','Position',[(x-5)/Sx (55)/Sy (250)/Sx (70)/Sy]);
  Han_In1(1)=uicontrol(Fig11,'Style','radio','String','Plot the output y(t)',...
  'Position',[(x)/Sx (100)/Sy (240)/Sx (h)/Sy],'Value',0);
  Han_In1(2)=uicontrol(Fig11,'Style','radio','String','Plot the control signal u(t)',...
  'Position',[(x)/Sx (80)/Sy (240)/Sx (h)/Sy],'Value',0);
  Han_In1(3)=uicontrol(Fig11,'Style','radio','String','Plot the error e(t)',...
  'Position',[(x)/Sx (60)/Sy (240)/Sx (h)/Sy],'Value',0);
  drawnow  

  for i = 1:3,  
    set(Han_In1(i),'UserData',Han_In1(:,[1:(i-1),(i+1):3]))
  end

  set(Han_In1(1),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ptype = 1;end;']);
  set(Han_In1(2),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ptype = 2;end;']);
  set(Han_In1(3),'CallBack',[call,'if get(han,''Value'') == 1,',...
   'ptype = 3;end;']);

  if ptype==1,
    set(Han_In1(1),'Value',1);
  elseif ptype==2,
    set(Han_In1(2),'Value',1);
  elseif ptype==3,
    set(Han_In1(3),'Value',1);
  end
else
  Han_In(1)=uicontrol(Fig11,'Style','frame','Position',[(x-5)/Sx (55)/Sy (270)/Sx (70)/Sy]);
  Han_In(2)=uicontrol(Fig11,'Style','text','String',...
  'There are only preferences for:','Position',...
  [(x)/Sx (y+100)/Sy (250)/Sx (20)/Sy]);
  Han_In(3)=uicontrol(Fig11,'Style','text','String',...
  'Bode plot, Nyquist plot, Step response','Position',...
  [(x)/Sx (y+80)/Sy (250)/Sx (20)/Sy]);
  Han_In(4)=uicontrol(Fig11,'Style','text','String',...
  'and Impulse Response','Position',...
  [(x)/Sx (y+60)/Sy (250)/Sx (20)/Sy]);
  set(Han_In(2:4),'Hor','left','For',[0 0 0])
end;

uicontrol(Fig11,'Style','push','String','Done','Position',...
[(15)/Sx (y+15)/Sy (80)/Sx (20)/Sy],'Callback',...
'close(Fig11);clear Fig11 Han_An1 Han_In1 Han_In2;');

end

clear okflag

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -