用matlab解方程组

问题描述:

用matlab解方程组
方程一:L1+L2*COS(TH1)=L3*COS(TH2)-L4*COS(TH3);方程二:L2*SIN(TH1)+L3*SIN()TH2-L4*SIN(TH3),其中把L1,L2,L3,L4,TH1当做已知量求TH2和TH3

clc,clear
syms L1 L2 L3 L4 TH1 TH2 TH3
[TH2,TH3]=solve('L1+L2*cos(TH1)-L3*cos(TH2)+L4*cos(TH3)','L2*sin(TH1)+L3*sin(TH2)-L4*sin(TH3)','TH2','TH3');
TH2=simplify(TH2)
TH3=simplify(TH3)