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

📄 cproot.m

📁 机器人控制仿真程序一书的所有源代码
💻 M
字号:
function h = cproot(zta,wn,w,flag)
% CPROOT Frequency response of complex root. (Utility Function)
%        CPROOT computes the magnitude response of a complex pole or
%        zero.

% Author: Craig Borghesani
% 9/3/93
% Copyright (c) 1995-98 by The MathWorks, Inc.
%       $Revision: 1.4 $

if length(flag)==1,
 s=sqrt(-1)*w(:)';
 ht=s.^2/(wn+(wn==0))^2+2*zta/(wn+(wn==0))*(wn~=0)*s+(wn~=0);
 zero=find(abs(ht)==0);
 if length(zero), ht(zero)=ones(1,length(zero))*eps; end
 h=ht.^flag;
else
 z=exp(sqrt(-1)*w(:)'*flag(2));
 fl=length(flag); T=flag(2);
 a=zta*wn; b=wn*sqrt(1-zta^2);
 ht=z-2*exp(-a*T)*cos(b*T)+exp(-2*a*T)./z;
 zero=find(abs(ht)==0);
 if length(zero), ht(zero)=ones(1,length(zero))*eps; end
 h=ht.^flag(1)*(abs(ht(1))^(-flag(1)));
end

⌨️ 快捷键说明

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