📄 fre2sys.m
字号:
function sys=fre2sys(fr,T,wt)
% sys=fre2sys(fr,T,wt) fits a stable, minimum phase MIMO system to
% the magnitude of the frequency response in the varying matrix fr.
% If T=0 (default) then sys is a continuous time system, otherwise,
% it is a discrete time system obtained by bilins2z(sys,T).
% The system is constructed with the function magfit.
% The (optional) varying matrix wt is a supplied
% frequency domain weighting function.
%
% Example:
% [a,b,c,d]=unpck(bilins2z(sysrand(4,2,3,1),1));
% fr=frsp(pck(a,b,c,d),logspace(-2,0,50),1);
% s5=fre2sys(fr,1);[a5,b5,c5,d5]=unpck(s5);
% subplot(2,1,1),dsigma(a,b,c,d,1);
% subplot(2,1,2),dsigma(a5,b5,c5,d5,1)
% This is the MuIdent version (without ord).
% It does not require the files s2s,sysbal3 and infnan2x.
% G. Campa 22/12/96
if nargin<3,wt=frsp(1,getiv(fr));end
if nargin<2,T=0;end
sys=[];
fr=sortiv(fr);
[ty1,no1,ni1,np1]=minfo(fr);
if fr(1,ni1+1)<=0,
[wmn,idx]=max((1:np1).*(fr(1:np1,ni1+1)'<=0));
fr=xtracti(fr,idx:np1);
end
for i=1:no1,
rs=[];
for j=1:ni1,
sij=magfit(vabs(sel(fr,i,j)),[.1 .1 1 3],wt);
rs=sbs(rs,sij);
end
sys=abv(sys,rs);
end
if T,
sys=bilins2z(sys,T);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -