Hey guys, I'm trying to solve for 2 angles that have the same sine value.
i.e. if x = asin(0.5), then x could be 30 degrees or 150 degrees.
I can't get this to come out though.
tried declaring a 1x2 symbolic variable x: [x1,x2], but if I try:
S = solve('x = asin(0.5)',x)
Then what I get out is:
x = 0.52... (30 degrees)
x1 = 0
x2 = 0
Can anyone help me out here? What am I doing wrong?
Thanks,
Joshua

 採用された回答

A Jenkins
A Jenkins 2015 年 1 月 19 日

0 投票

>> syms x
>> solve('0.5 = sin(x)',x)
ans =
0.52359877559829887307710723054658
2.6179938779914943653855361527329

3 件のコメント

Joshua D'Agostino
Joshua D'Agostino 2015 年 1 月 19 日
Oh I see, I'm doing it the wrong way around. Thanks bud! Any idea why it doesn't work doing it the way I initially had it though?
A Jenkins
A Jenkins 2015 年 1 月 19 日
arcsin is defined to only return the principal value. The documentation says:
For real elements of x in the interval [-1,1], asin(x) returns values in the interval [-pi/2,pi/2]. For real elements of x outside the interval [-1,1] and for complex values of x, asin(x) returns complex values.
Joshua D'Agostino
Joshua D'Agostino 2015 年 1 月 20 日
Oh I see. Gotcha, cheers mate

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by