多用用符号求解
符号可以求出精确解:>> solve('sin(x)=cos(x)')
ans =
1/4*pi
>> f2=solve('tan(2*x)=sin(x)')
f2 =
[ 0]
[ pi]
[ atan(1/2*(-2*3^(1/2))^(1/2),1/2+1/2*3^(1/2))]
[ atan(-1/2*(-2*3^(1/2))^(1/2),1/2+1/2*3^(1/2))]
[ atan(1/2*2^(1/2)*3^(1/4)/(1/2-1/2*3^(1/2)))+pi]
[ -atan(1/2*2^(1/2)*3^(1/4)/(1/2-1/2*3^(1/2)))-pi]
>> [x,y,z]=solve('x+y+z=1','x-y+z=2','2*x-y-z=1')
x =
2/3
y =
-1/2
z =
5/6
求解小问题的时候,多用符号方法,可能会有意想不到的效果哟