📄 finsert.m
字号:
function [fi,wi]=finsert(w,f,wadd,a,b,c,d,iu)
%FINSERT Insert frequency points in MVFR matrix
% FINSERT(W,F,WADD,A,B,C,D,iu) inserts the component matrices
% calculated at frequencies WADD into the MVFR matrix, F,
% and returns the result sorted with respect to frequency.
% W is the associated frequency vector of F.
% The A,B,C,D matrices specify the system in state space form.
% The input argument iu is optional and specifies
% that the system was calculated for the single input, iu.
%
% FINSERT(W,F,WADD,NUM,COMDEN,iu) does the same for systems
% specified in Transfer Function Matrix form.
%
% [FI,WI]=FINSERT(W,F,WADD,A,B,C,D,iu) and
% [FI,WI]=FINSERT(W,F,WADD,NUM,COMDEN,iu)
% returns both the expanded and sorted MVFR matrix, FS,
% and the associated frequency vector, WS.
% See also MV2FR
% Dr M.P. Ford 4th August 1987
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd
nargs=nargin;
error(nargchk(5,8,nargs));
if nargs >= 8 % state space form with iu
f1=mv2fr(a,b,c,d,wadd,iu);
elseif nargs == 7 % state space form no iu
f1=mv2fr(a,b,c,d,wadd);
elseif nargs == 6 % transfer function with iu
f1=mv2fr(a,b,wadd,c);
else nargs == 5 % transfer function no iu
f1=mv2fr(a,b,wadd);
end
[m,n]=size(w);
[m1,n1]=size(wadd);
if (min(m,n)~=1)|(min(m1,n1)~=1)
error('Frequency vectors must be vectors.');
end
if m==1 % row vector
wi=[w,wadd(:)'];
else % column vector
wi=[w;wadd(:)];
end
[wi,i]=sort(wi);
fi=fgetf(wi,[f;f1],i);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -