mathematical equation in matlab

조회 수: 2 (최근 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 CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by