Using the solve function for a more complex variable
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
the equations are as follows
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/317886/image.png)
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/317889/image.png)
採用された回答
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
2020 年 6 月 23 日
Noel next time please show some efforts and don’t expect others to write the code for you.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!