フィルターのクリア

Function "solve" returns a struct

20 ビュー (過去 30 日間)
Marina Carnemolla
Marina Carnemolla 2019 年 7 月 28 日
編集済み: Stephan 2019 年 7 月 28 日
Hi, I have the following equation:
where are defined by syms.
I need to find in that equation, so my solution should be:
I have used the following code:
sol=solve(equation==0, cos(q1))
However, what I get in my console is:
sol =
struct with fields:
q1: [0×1 sym]
q2: [0×1 sym]
Then I added:
sol.q1
and I got in the console:
ans =
Empty sym: 0-by-1

回答 (1 件)

Stephan
Stephan 2019 年 7 月 28 日
編集済み: Stephan 2019 年 7 月 28 日
syms a1 a2 q1 q2
eq = a1*cos(q1) + a2*cos(q1)*cos(q2) - a2*sin(q1)*sin(q2) == 0
sol = isolate(eq,cos(q1))
pretty(sol)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by