About getting answers with "SYM" function

1 view (last 30 days)
Hi guys,
Now I am try to getting start with Matlab.
I get a equation
Px=sym('(L1+L2*cos(A2)+L3*cos(A2+A3))*cos(A1)')
A1 A2 A3 L1 L2 L3 are some variables
How can I put the value to those variables and finally get the value of Px?
Thanks a lot!!
  2 Comments
Bruno Pop-Stefanov
Bruno Pop-Stefanov on 22 Jan 2014
What are you trying to do with sym? If you just want to evaluate this formula given your variables then:
A1 = 1;
A2 = 2;
A3 = 3;
L1 = 11;
L2 = 22;
L3 = 33;
Px = ( L1 + L2*cos(A2) + L3*cos(A2+A3) )*cos(A1)
will give you the answer.
Chan
Chan on 22 Jan 2014
Thanks for your help! it helpful.
But I still got other problem.
Now I have 3 equation.
Px=(L1+L2*cos(A2)+L3*cos(A2+A3))*cos(A1)
Py=(L1+L2*cos(A2)+L3*cos(A2+A3))*sin(A1)
Pz=(L2*sin(A2)+L3*sin(A2+A3))
Any methods that matlab can help me to transfer the equations like this:
A1=????????????
A2=????????????
A3=????????????
Because I need to know each value of A1 A2 A3 by given Px,Py,Pz,L1,L2,L3.
Thanks!!!

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 22 Jan 2014
Edited: Walter Roberson on 22 Jan 2014
solve(Px==(L1+L2*cos(A2)+L3*cos(A2+A3))*cos(A1), Py==(L1+L2*cos(A2)+L3*cos(A2+A3))*sin(A1), Pz==(L2*sin(A2)+L3*sin(A2+A3)), A1, A2, A3)

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!