MATLAB解方程高手进,就是一行程序,syms x y z p3 p33 p333 radius alfa ax ay az A B C ;[x,y,z]=solve('(x-p3)^2+(y-p33)^2+(z-p333)^2=radius^2','(x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2','A*(x-p3)+B*(y-p33)+C*(x-p333)=0','x','y','z
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 00:16:44
MATLAB解方程高手进,就是一行程序,syms x y z p3 p33 p333 radius alfa ax ay az A B C ;[x,y,z]=solve('(x-p3)^2+(y-p33)^2+(z-p333)^2=radius^2','(x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2','A*(x-p3)+B*(y-p33)+C*(x-p333)=0','x','y','z
MATLAB解方程高手进,就是一行程序,
syms x y z p3 p33 p333 radius alfa ax ay az A B C ;
[x,y,z]=solve('(x-p3)^2+(y-p33)^2+(z-p333)^2=radius^2','(x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2','A*(x-p3)+B*(y-p33)+C*(x-p333)=0','x','y','z')
错误Error using ==> solve
' (x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2 ' is not a valid expression or equation.
MATLAB解方程高手进,就是一行程序,syms x y z p3 p33 p333 radius alfa ax ay az A B C ;[x,y,z]=solve('(x-p3)^2+(y-p33)^2+(z-p333)^2=radius^2','(x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2','A*(x-p3)+B*(y-p33)+C*(x-p333)=0','x','y','z
第二个表达式(x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2中等号右面的小括号是中文输入法下的小括号,需要改成英文输入法下的小括号;即:[x,y,z]=solve('(x-p3)^2+(y-p33)^2+(z-p333)^2=radius^2','(x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2','A*(x-p3)+B*(y-p33)+C*(x-p333)=0','x','y','z');
(x-ax)^2+(y-ay)^2+(z-az)^2=(2*radius*sin(alfa/2))^2这个式子,左边运算结果是矩阵,右边运算结果是具体数字,显然不能等
我手头没matlab,但我发现=(2*radius*sin这个括号是全角的不是半角的