为什么枚举要实现接口?
246
2022-10-31
数字信号处理、6.43MATLAB验证:
6.43MATLAB验证: [r,p,k]=residuez([0 1 1.7],conv([1 0.3],[1 -0.5]))
r =
5.50005.8333
p =
0.5000
-0.3000
k =
-11.3333
M6.1
factorize.m:function Factors = factorize(polyn) format long; Factors = []; % Use threshold of 1e-8 instead of 0 to account for % precision effects THRESH = 1e-8; % proots = roots(polyn); % get the zeroes of the polynomial len = length(proots); % get the number of zeroes % while(len > 1) if(abs(imag(proots(1))) < THRESH) % if the zero is a real zero fac = [1 -real(proots(1))]; % construct the factor with proots(1) as zero Factors = [Factors;[fac 0]]; else % if the zero has imaginary part get all zeroes whose % imag part is -ve of imaginary part of proots(1) negimag = imag(proots)+imag(proots(1)); % get all zeroes which have same real part as proot(1) samereal = real(proots)-real(proots(1)); %find the complex conjugate zero index = find(abs(negimag) 脚本: num = input('Type in the numerator coefficients = ');den = input('Type in the denominator coefficients = ');K = num(1)/den(1);Numfactors = factorize(num)Denfactors = factorize(den)disp('Numerator factors');disp(Numfactors);disp('Denominator factors');disp(Denfactors);disp('Gain constant');disp(K);zplane(num,den) 输入: Type in the numerator coefficients = [3 -2.4 15.36 3.84 9] Type in the denominator coefficients = [5 -8.5 17.6 4.7 -6] 输出: 输入: Type in the numerator coefficients = [2 0.2 6.4 4.6 2.4] Type in the denominator coefficients = [5 1 6.6 0.42 24] 输出:
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~