用Matlab解一个一元三次方程的时候,计算结果为什么是这个样子,怎样更换显示的形式 5
>>symsax>>solve('x^3+a*x+1')ans=[a][1/6%1-2------------------------------][31/21/3][(...
>> syms a x
>> solve('x^3+a*x+1')
ans =
[ a ]
[1/6 %1 - 2 ------------------------------]
[ 3 1/2 1/3]
[ (-108 + 12 (12 a + 81) ) ]
[ a
[- 1/12 %1 + ------------------------------
[ 3 1/2 1/3
[ (-108 + 12 (12 a + 81) )
1/2 / a \]
+ 1/2 i 3 |1/6 %1 + 2 ------------------------------|]
| 3 1/2 1/3|]
\ (-108 + 12 (12 a + 81) ) /]
[ a
[- 1/12 %1 + ------------------------------
[ 3 1/2 1/3
[ (-108 + 12 (12 a + 81) )
1/2 / a \]
- 1/2 i 3 |1/6 %1 + 2 ------------------------------|]
| 3 1/2 1/3|]
\ (-108 + 12 (12 a + 81) ) /]
3 1/2 1/3
%1 := (-108 + 12 (12 a + 81) ) 展开
>> solve('x^3+a*x+1')
ans =
[ a ]
[1/6 %1 - 2 ------------------------------]
[ 3 1/2 1/3]
[ (-108 + 12 (12 a + 81) ) ]
[ a
[- 1/12 %1 + ------------------------------
[ 3 1/2 1/3
[ (-108 + 12 (12 a + 81) )
1/2 / a \]
+ 1/2 i 3 |1/6 %1 + 2 ------------------------------|]
| 3 1/2 1/3|]
\ (-108 + 12 (12 a + 81) ) /]
[ a
[- 1/12 %1 + ------------------------------
[ 3 1/2 1/3
[ (-108 + 12 (12 a + 81) )
1/2 / a \]
- 1/2 i 3 |1/6 %1 + 2 ------------------------------|]
| 3 1/2 1/3|]
\ (-108 + 12 (12 a + 81) ) /]
3 1/2 1/3
%1 := (-108 + 12 (12 a + 81) ) 展开
1个回答
展开全部
这个已经化简不到哪去了。因为里面有变量参数a,而且解出来有虚数解;
真要化简的话用simple(ans)
ans =
1/6*((-108+12*(12*a^3+81)^(1/2))^(2/3)-12*a)/(-108+12*(12*a^3+81)^(1/2))^(1/3)
1/12*(-(-108+12*(12*a^3+81)^(1/2))^(2/3)+12*a+i*3^(1/2)*(-108+12*(12*a^3+81)^(1/2))^(2/3)+12*i*3^(1/2)*a)/(-108+12*(12*a^3+81)^(1/2))^(1/3)
1/12*(-(-108+12*(12*a^3+81)^(1/2))^(2/3)+12*a-i*3^(1/2)*(-108+12*(12*a^3+81)^(1/2))^(2/3)-12*i*3^(1/2)*a)/(-108+12*(12*a^3+81)^(1/2))^(1/3)
真要化简的话用simple(ans)
ans =
1/6*((-108+12*(12*a^3+81)^(1/2))^(2/3)-12*a)/(-108+12*(12*a^3+81)^(1/2))^(1/3)
1/12*(-(-108+12*(12*a^3+81)^(1/2))^(2/3)+12*a+i*3^(1/2)*(-108+12*(12*a^3+81)^(1/2))^(2/3)+12*i*3^(1/2)*a)/(-108+12*(12*a^3+81)^(1/2))^(1/3)
1/12*(-(-108+12*(12*a^3+81)^(1/2))^(2/3)+12*a-i*3^(1/2)*(-108+12*(12*a^3+81)^(1/2))^(2/3)-12*i*3^(1/2)*a)/(-108+12*(12*a^3+81)^(1/2))^(1/3)
更多追问追答
追问
我知道啊,可是我的matab显示的不是和你显示的一样。我的意思是怎样更换这种显示的形式。也就是和你计算的结果一样,而不是我问题当中的那种。
追答
我的MATLAB输出显示默认就是以上结果,你这种结果我的显示不出来,不知道是怎么回事。可以试试先format再输出试试。
>> format
>> syms a x
>> solve('x^3+a*x+1')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询