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

📄 mknic.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function mknic(mag,ph,w,plt)
%MKNIC  Mark points along a Nichols plot.
%       MKNIC(MAG,PH,W,plt) marks the points MAG,PH
%       with the numbers in the vector W.
%       MAG,PH can be vectors or matrices.
%       If matrices columns are plotted against columns.
%       The input argument plt is optional and indicates
%       the number of plots per page either 1 or 4.
%       The default is 4.
%
%       MKNIC(C,W,plt) converts complex C to MAG and PH
%       and applies UNWRAP to PH before marking the plot.
%       Note C must have at least 1 non-zero imaginary part.
%
%       After converting the MAG to dB's
%       the plot is marked using MKPLOT.
%       MKPLOT turns HOLD OFF.
%       It also toggles the AXIS command.
%       See MKPLOT for more details.
%       See also PLOTNIC,R2P,UNWRAP,SUBPLOT.

%       Dr M.P. Ford 4th August 1987
% Copyright (c) 1987,1993 by GEC Engineering Research Centre and 
% Cambridge Control Ltd. All Rights Reserved.
% History: MRN0019
%   `fixphase' replaced by `unwrap', 29.5.93, JMM.

nargs=nargin;
error(nargchk(2,4,nargs));
if nargs==2
   w=ph;
   [mag,ph]=r2p(mag); % ph is in degrees
   ph=(180/pi)*unwrap(ph*pi/180); % fixphase replaced by unwrap,29.5.93,JMM.
   plt=4;
elseif nargs==3
   if (any(any(imag(mag))))
     plt=w;
     w=ph;
     [mag,ph]=r2p(mag); % ph is in degrees
     ph=(180/pi)*unwrap(ph*pi/180); %fixphase replaced by unwrap,29.5.93,JMM. 
   else
     plt=4;
   end
% else nargs==4   use the inputs as is
end
mag=20 .*log10(mag);
mkplot(ph,mag,w,plt);

⌨️ 快捷键说明

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