plotnyq.m

来自「包含大量遗传算法程序」· M 代码 · 共 42 行

M
42
字号
function plotnyq(r,im,linetype)
%PLOTNYQ Plot Nyquist diagrams.
%       PLOTNYQ(C,'linetype') plots Nyquist plots of the
%       complex matrix or vector C.
%       If C is a matrix columns are plotted against columns.
%       The input argument linetype is optional.
%       If it is present it is used to plot line or point type.
%       See PLOT for valid linetypes.
%
%       PLOTNYQ(R,IM,'linetype') plots the real and imag in
%       Nyquist format with labels and grid.
%
%       See also MKNYQ,PLOT,PLOTNIC,PLOTBODE,NCIRC,MCIRC

% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd

nargs=nargin;
error(nargchk(1,3,nargs));

if nargs==1
   linetype=' ';
   im=imag(r);
   r = real(r);
end  % if nargs==1

if nargs ==2
  if isstr(im)
     linetype = im;
     im=imag(r);
     r = real(r);
  else
     linetype = ' ';
  end
end % if nargs==2

if linetype==' '
   plot(r,im),grid,xlabel('REAL'),ylabel('IMAG')
else
   plot(r,im,linetype),grid,xlabel('REAL'),ylabel('IMAG')
end

⌨️ 快捷键说明

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