mathematical equation in matlab

4 ビュー (過去 30 日間)
Shehab Tarek
Shehab Tarek 2020 年 6 月 8 日
コメント済み: madhan ravi 2020 年 6 月 8 日
how to write this equation in matlab
angle=tan(2*pi*0.25) but i want it in radian form
i know its equal 1/0

採用された回答

madhan ravi
madhan ravi 2020 年 6 月 8 日
Angle = tan(sym((2*pi*0.25)))

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 6 月 8 日
angle = sinpi(2*0.25) / cospi(2*0.25)
That is, there is no tanpi() function but there is a sinpi() and cospi() that are intended to be more accurate for these kinds of boundary cases.
If you have the symbolic toolbox you could also
Pi = sym(pi); %specially recognized
angle = tan(2 * Pi * 0.25)
  1 件のコメント
madhan ravi
madhan ravi 2020 年 6 月 8 日
Also better is to not name a variable angle because there's an inbuilt function named angle(...)

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

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by