Using the solve function for a more complex variable

조회 수: 3 (최근 30일)
Noel Loh
Noel Loh 2020년 6월 17일
편집: Noel Loh 2020년 6월 23일
Hello,
the equations are as follows
i am trying to find cos2 (noted by c2) and sin2 (noted by s2), this is very simple if i did it via hand, but i am trying to solve this using matlab coding and i require some help as i cant seem to get the right answer using the solve function.
solution:

채택된 답변

Devineni Aslesha
Devineni Aslesha 2020년 6월 23일
Hi Noel,
Use the solve function to find the solution for the above equations as shown below.
syms x y z s1 s2 c1 c2
eqn1 = x + s1*c2 == 0;
eqn2 = y - s1*s2 == 0;
eqn3 = z - c1 == 0;
eqns = [eqn1 eqn2 eqn3];
sol = solve(eqns,[c2 s2 z]);
Here, sol.c2, sol.s2 and sol.z are the required solutions
For more information, refer the following link
  댓글 수: 3
madhan ravi
madhan ravi 2020년 6월 23일
Noel next time please show some efforts and don’t expect others to write the code for you.
Noel Loh
Noel Loh 2020년 6월 23일
편집: Noel Loh 2020년 6월 23일
thanks for your help mvp, i have spent weeks trying to solve it despite not being great at coding, finally solved it a few days ago, only to be recently reminded about the topic when an actual helpful person today helped give input on a possible solution, decided to thank the person's efforts without being rude, but also hear a supposingly mvp suddenly came in throwing an useless comment just to massage his tiny ego, but your comment helped i guess, good job.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by