matlab中计算四次方方程a*x^4+b*x+c=0的实数根.

问题描述:

matlab中计算四次方方程a*x^4+b*x+c=0的实数根.
我是想计算a*x^4+b*x+c=0的x根,但是a、b、c是需要计算的,我想问下在matlab里如何计算呢?我只要那个正实数根,其他的都不要.在百度上看到你回答类似的问题,但是不是很明白.

syms a x b c
y = a*x^4+b*x+c;
Y = solve(y, 'x')
结果如下:
ans =

1/12*6^(1/2)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)+1/12*(-(6*12^(1/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+24*12^(2/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*c*a+72*b*6^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3)/(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2))^(1/2)
1/12*6^(1/2)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)-1/12*(-(6*12^(1/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+24*12^(2/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*c*a+72*b*6^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3)/(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2))^(1/2)
-1/12*6^(1/2)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)+1/12*(-(6*12^(1/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+24*12^(2/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*c*a-72*b*6^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3)/(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2))^(1/2)
-1/12*6^(1/2)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)-1/12*(-(6*12^(1/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+24*12^(2/3)*(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2)*c*a-72*b*6^(1/2)*((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3)/(12^(1/3)*(((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(2/3)+4*c*12^(1/3)*a)/a/((9*b^2+(-768*c^3*a+81*b^4)^(1/2))*a)^(1/3))^(1/2))^(1/2)