how to write ( a=(arctan(b/c)*pi*r)/90) in Matlab 2014

4 ビュー (過去 30 日間)
harshal j
harshal j 2015 年 12 月 10 日
コメント済み: harshal j 2015 年 12 月 15 日
Hi i want to write (arctan(b/c)*pi*r)/90)this formula in matlab 2014, I don't know how to write 'arctan' in matlab 2014. plase help, thanks in advance
  2 件のコメント
Walter Roberson
Walter Roberson 2015 年 12 月 10 日
Are you sure that it is multiply by pi and divide by 90, and not multiply by 90 and divide by pi?
Are you trying to get an answer in degrees or in radians or in some other units? The MATLAB arctan functions return radians, but that formula looks like it is trying to find the radians of 1/2 of an angle expressed in degrees.
harshal j
harshal j 2015 年 12 月 10 日
Thanks for the comments, yes the formula is correct and it is multiply by pi and divide by 90. I am trying to find the values in degree. Please help if possible

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

採用された回答

Torsten
Torsten 2015 年 12 月 10 日
編集済み: Torsten 2015 年 12 月 10 日

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 12 月 10 日
If you want the arctan of b/c and you want it expressed in degrees, then use atand()
atand(b/c)
The result will be in the range -90 to +90. atand() cannot be used for the full 4-quadrant arctan
The normal arctan functions are atan() and atan2(), both of which return radians. atan(b/c) returns [-pi/2, pi/2] radians and atan2(b,c) returns [-pi, pi] radians.
The conversion from radians to degrees is to multiply by 180 and divide by pi. Applying that to the [-pi, pi] range would be +/- pi*(180/pi) which would be +/- 180 as you would hope for a 4-quadrant arctan. The formula you were using would be for +/- pi*(pi/90) which would be +/- pi^2/90 which would be about +/- 0.1097
It is not clear why you would multiply an angle by r, especially if r represents a radius??
Please re-check your formula as it seems likely to be wrong.
  2 件のコメント
harshal j
harshal j 2015 年 12 月 15 日
Thanks for the answe, it will solve my problem
harshal j
harshal j 2015 年 12 月 15 日
I will recheck the formula and thank u so much for correcting the formula.

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

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by