x=(-1:0.01:1);syms w;p_pie=(w-1.6)*(w+1.2)*(w-1.5)*(w-1.2);%fitting p=sqrt(2)*p_pie,the roots of p is equal to p_pie
p_pie=sym2poly(p_pie);r_pie=roots(p_pie)p=sqrt(2)*polyval(p_pie,x);p_fit=polyfit(p,x,4);r=roots(p_fit)% r_pie =
%
% -1.200000000000000
% 1.599999999999999
% 1.500000000000008
% 1.199999999999997
% r =
% % -8.611410578949965 + 0.000000000000000i
% 0.893177977748609 + 4.949441426509091i
% 0.893177977748609 - 4.949441426509091i
% -3.860244385178206 + 0.000000000000000i
MATLAB: Why polyfit poly roots is not equal to primitive poly roots
MATLAB and Simulink Student Suitepolyfit poly roots is not equal to primitive poly roots
Best Answer