请帮助用matlab算一下三个方程的全部根,谢谢.
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/18 13:00:06
请帮助用matlab算一下三个方程的全部根,谢谢.
537265*x^6-7752905*x+7215640=0
537265*x^6-6879917*x+6342652=0
537265*x^6-6195671*x+5658406=0
537265*x^6-7752905*x+7215640=0
537265*x^6-6879917*x+6342652=0
537265*x^6-6195671*x+5658406=0
代码:
clc;clear;
p1 = [537265,0,0,0,0,-7752905,7215640];
p2 = [537265,0,0,0,0,-6879917,6342652];
p3 = [537265,0,0,0,0,-6195671,5658406];
x1 = roots(p1);
x2 = roots(p2);
x3 = roots(p3);
x1
x2
x3
结果:
x1 =
-1.5271 + 1.0207i
-1.5271 - 1.0207i
0.3522 + 1.6808i
0.3522 - 1.6808i
1.3498 + 0.0000i
1.0000 + 0.0000i
x2 =
-1.4927 + 0.9970i
-1.4927 - 0.9970i
0.3419 + 1.6426i
0.3419 - 1.6426i
1.3016 + 0.0000i
1.0000 + 0.0000i
x3 =
-1.4631 + 0.9766i
-1.4631 - 0.9766i
0.3333 + 1.6097i
0.3333 - 1.6097i
1.2596 + 0.0000i
1.0000 + 0.0000i
clc;clear;
p1 = [537265,0,0,0,0,-7752905,7215640];
p2 = [537265,0,0,0,0,-6879917,6342652];
p3 = [537265,0,0,0,0,-6195671,5658406];
x1 = roots(p1);
x2 = roots(p2);
x3 = roots(p3);
x1
x2
x3
结果:
x1 =
-1.5271 + 1.0207i
-1.5271 - 1.0207i
0.3522 + 1.6808i
0.3522 - 1.6808i
1.3498 + 0.0000i
1.0000 + 0.0000i
x2 =
-1.4927 + 0.9970i
-1.4927 - 0.9970i
0.3419 + 1.6426i
0.3419 - 1.6426i
1.3016 + 0.0000i
1.0000 + 0.0000i
x3 =
-1.4631 + 0.9766i
-1.4631 - 0.9766i
0.3333 + 1.6097i
0.3333 - 1.6097i
1.2596 + 0.0000i
1.0000 + 0.0000i