?? evaltf.m
字號:
function h = evalTF(tf,z)%h = evalTF(tf,z)%Evaluates the rational function described by the struct tf% at the point(s) given in the z vector.% TF must be either a zpk object or a struct containing% form 'zp' or 'coeff'% zeros,poles,k if form=='zp'% num,den if form=='coeff'%% In Matlab 5, the ss/freqresp() function does nearly the same thing.if isobject(tf) % zpk object if strcmp(class(tf),'zpk') h = tf.k * evalRPoly(tf.z{1},z) ./ evalRPoly(tf.p{1},z); else fprintf(1,'%s: Only zpk objects supported.\n', mfilename); endelseif any(strcmp(fieldnames(tf),'form')) if strcmp(tf.form,'zp') h = tf.k * evalRPoly(tf.zeros,z) ./ evalRPoly(tf.poles,z); elseif strcmp(form,'coeff') h = polyval(tf.num,z) ./ polyval(tf.den,z); else fprintf(1,'%s: Unknown form: %s\n', mfilename, tf.form); endelse % Assume zp form h = tf.k * evalRPoly(tf.zeros,z) ./ evalRPoly(tf.poles,z);end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -