用MATLAB解方程的问题 急~~

我是个刚学习MATLAB的新手本来想用18个方程解18个未知数用的命令如下l1=20[l2,l3,l4,l5,l6,l7,l8,l9,a1,a2,a3,a4,a5,a6,... 我是个刚学习MATLAB的新手 本来想用18个方程解18个未知数 用的命令如下
l1=20
[l2,l3,l4,l5,l6,l7,l8,l9,a1,a2,a3,a4,a5,a6,a7,a8,a9,a11]=solve('(l5+l1*cos(a1)-l3*cos(a2))^2+(l4+l3*sin(a2)-l1*sin(a1))^2=l2^2','l4+l6*sin(a2)=l1*sin(a1+pi)-sqrt(l7^2*(l1*sin(a1+pi)-l8)^2/((l8-l1*sin(a1+pi))^2+(l1*cos(a1+pi)-l9)^2)','(l5+l1*cos(a1+pi/5)-l3*cos(a3))^2+(l4+l3*sin(a3)-l1*sin(a1+pi/5))^2=l2^2','l4+l6*sin(a3)=l1*sin(a1+pi+pi/5)-sqrt(l7^2*(l1*sin(a1+pi+pi/5)-l8)^2/((l8-l1*sin(a1+pi+pi/5))^2+(l1*cos(a1+pi+pi/5)-l9)^2)','l4+l6*sin(a4)=l1*sin(a1+pi*7/5)-sqrt(l7^2*(l1*sin(a1+pi*7/5)-l8)^2/((l8-l1*sin(a1+pi*7/5))^2+(l1*cos(a1+pi*7/5)-l9)^2)','l4+l6*sin(a5)=l1*sin(a1+pi*8/5)-sqrt(l7^2*(l1*sin(a1+pi*8/5)-l8)^2/((l8-l1*sin(a1+pi*8/5))^2+(l1*cos(a1+pi*8/5)-l9)^2)','l4+l6*sin(a6)=l1*sin(a1+pi*9/5)-sqrt(l7^2*(l1*sin(a1+pi*9/5)-l8)^2/((l8-l1*sin(a1+pi*9/5))^2+(l1*cos(a1+pi*9/5)-l9)^2)','l4+l6*sin(a7)=l1*sin(a1+pi*4/5)-sqrt(l7^2*(l1*sin(a1+pi*4/5)-l8)^2/((l8-l1*sin(a1+pi*4/5))^2+(l1*cos(a1+pi*4/5)-l9)^2)','l4+l6*sin(a8)=l1*sin(a1+pi*3/5)-sqrt(l7^2*(l1*sin(a1+pi*3/5)-l8)^2/((l8-l1*sin(a1+pi*3/5))^2+(l1*cos(a1+pi*3/5)-l9)^2)','l4+l6*sin(a9)=l1*sin(a1+pi*2/5)-sqrt(l7^2*(l1*sin(a1+pi*2/5)-l8)^2/((l8-l1*sin(a1+pi*2/5))^2+(l1*cos(a1+pi*2/5)-l9)^2)','l4+l6*sin(a11)=l1*sin(a1)-sqrt(l7^2*(l1*sin(a1)-l8)^2/((l8-l1*sin(a1))^2+(l1*cos(a1)-l9)^2)','(l5+l1*cos(a1+pi*2/5)-l3*cos(a4))^2+(l4+l3*sin(a4)-l1*sin(a1+pi*2/5))^2=l2^2','(l5+l1*cos(a1+3*pi/5)-l3*cos(a5))^2+(l4+l3*sin(a5)-l1*sin(a1+3*pi/5))^2=l2^2','(l5+l1*cos(a1+4*pi/5)-l3*cos(a6))^2+(l4+l3*sin(a6)-l1*sin(a1+4*pi/5))^2=l2^2','(l5+l1*cos(a1-pi/5)-l3*cos(a7))^2+(l4+l3*sin(a7)-l1*sin(a1-pi/5))^2=l2^2','(l5+l1*cos(a1-2*pi/5)-l3*cos(a8))^2+(l4+l3*sin(a8)-l1*sin(a1-2*pi/5))^2=l2^2','(l5+l1*cos(a1-3*pi/5)-l3*cos(a9))^2+(l4+l3*sin(a9)-l1*sin(a1-3*pi/5))^2=l2^2','(l5+l1*cos(a1-pi)-l3*cos(a11))^2+(l4+l3*sin(a11)-l1*sin(a1-pi))^2=l2^2')
但是运行后就出现
??? Error using ==> solve
'l4+l6*sin(a2)=l1*sin(a1+pi)-sqrt(l7^2*(l1*sin(a1+pi)-l8)^2/((l8-l1*sin(a1+pi))^2+(l1*cos(a1+pi)-l9)^2)' is not a valid expression or equation.
不知道是什么原因 不知道怎么解决这个问题
求能解决这个问题的方法...求高手帮忙...
近期要急用这个数据...主要是l2~9的值 分不够了...
谢谢你啊
虽然你帮我改的程序能够运行了,但是运行了半天之后,还是解不出答案,按理说方程数够,未知数也相当,总应该有解的,最多是虚数解嘛
怎么他连一个解都没有...
展开
 我来答
anthony87
2009-05-07 · TA获得超过1036个赞
知道小有建树答主
回答量:459
采纳率:0%
帮助的人:244万
展开全部
没有 等号 等式 右边 是 0 不用输

还有 你括号 打乱了

%%%%%%%%
%哥们 我给你改了好半天
l1=20;
[l2,l3,l4,l5,l6,l7,l8,l9,a1,a2,a3,a4,a5,a6,a7,a8,a9,a11]=solve(...
'(l5+l1*cos(a1)-l3*cos(a2))^2+(l4+l3*sin(a2)-l1*sin(a1))^2-l2^2', ...
'-l4-l6*sin(a2)+l1*sin(a1+pi)-sqrt(l7^2*(l1*sin(a1+pi)-l8)^2/((l8-l1*sin(a1+pi))^2+(l1*cos(a1+pi)-l9)^2))',...
'(l5+l1*cos(a1+pi/5)-l3*cos(a3))^2+(l4+l3*sin(a3)-l1*sin(a1+pi/5))^2-l2^2',...
'-l4-l6*sin(a3)+l1*sin(a1+pi+pi/5)-sqrt(l7^2*(l1*sin(a1+pi+pi/5)-l8)^2/((l8-l1*sin(a1+pi+pi/5))^2+(l1*cos(a1+pi+pi/5)-l9)^2))',...
'-l4-l6*sin(a4)+l1*sin(a1+pi*7/5)-sqrt(l7^2*(l1*sin(a1+pi*7/5)-l8)^2/((l8-l1*sin(a1+pi*7/5))^2+(l1*cos(a1+pi*7/5)-l9)^2))',...
'-l4-l6*sin(a5)+l1*sin(a1+pi*8/5)-sqrt(l7^2*(l1*sin(a1+pi*8/5)-l8)^2/((l8-l1*sin(a1+pi*8/5))^2+(l1*cos(a1+pi*8/5)-l9)^2))',...
'-l4-l6*sin(a6)+l1*sin(a1+pi*9/5)-sqrt(l7^2*(l1*sin(a1+pi*9/5)-l8)^2/((l8-l1*sin(a1+pi*9/5))^2+(l1*cos(a1+pi*9/5)-l9)^2))',...
'-l4-l6*sin(a7)+l1*sin(a1+pi*4/5)-sqrt(l7^2*(l1*sin(a1+pi*4/5)-l8)^2/((l8-l1*sin(a1+pi*4/5))^2+(l1*cos(a1+pi*4/5)-l9)^2))',...
'-l4-l6*sin(a8)+l1*sin(a1+pi*3/5)-sqrt(l7^2*(l1*sin(a1+pi*3/5)-l8)^2/((l8-l1*sin(a1+pi*3/5))^2+(l1*cos(a1+pi*3/5)-l9)^2))',...
'-l4-l6*sin(a9)+l1*sin(a1+pi*2/5)-sqrt(l7^2*(l1*sin(a1+pi*2/5)-l8)^2/((l8-l1*sin(a1+pi*2/5))^2+(l1*cos(a1+pi*2/5)-l9)^2))',...
'-l4-l6*sin(a11)+l1*sin(a1)-sqrt(l7^2*(l1*sin(a1)-l8)^2/((l8-l1*sin(a1))^2+(l1*cos(a1)-l9)^2))',...
'(l5+l1*cos(a1+pi*2/5)-l3*cos(a4))^2+(l4+l3*sin(a4)-l1*sin(a1+pi*2/5))^2-l2^2',...
'(l5+l1*cos(a1+3*pi/5)-l3*cos(a5))^2+(l4+l3*sin(a5)-l1*sin(a1+3*pi/5))^2-l2^2',...
'(l5+l1*cos(a1+4*pi/5)-l3*cos(a6))^2+(l4+l3*sin(a6)-l1*sin(a1+4*pi/5))^2-l2^2',...
'(l5+l1*cos(a1-pi/5)-l3*cos(a7))^2+(l4+l3*sin(a7)-l1*sin(a1-pi/5))^2-l2^2',...
'(l5+l1*cos(a1-2*pi/5)-l3*cos(a8))^2+(l4+l3*sin(a8)-l1*sin(a1-2*pi/5))^2-l2^2',...
'(l5+l1*cos(a1-3*pi/5)-l3*cos(a9))^2+(l4+l3*sin(a9)-l1*sin(a1-3*pi/5))^2-l2^2',...
'(l5+l1*cos(a1-pi)-l3*cos(a11))^2+(l4+l3*sin(a11)-l1*sin(a1-pi))^2-l2^2')

我机器正在解方程,不好解
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
方程太复杂了,太浪费时间了
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式