How to use tan(X) in matlab

조회 수: 2 (최근 30일)
Jongmin Paik
Jongmin Paik 2020년 3월 26일
댓글: Walter Roberson 2020년 3월 26일
f_f0=(0:0.1:5)'
Bl=(pi/2)*f_f0
v=tan(Bl)
In this coding, values of 'v' are all '0'.
I don't know where this coding was wrong.
Please help.
  댓글 수: 6
Jongmin Paik
Jongmin Paik 2020년 3월 26일
You say trying '0:0.1:5' was wrong..
Then How to use tangent for 0:0.1:5?
Torsten
Torsten 2020년 3월 26일
No, not wrong, but the difference in magnitude of thenumbers of the output is large.
You will haveto change the output format.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 3월 26일
Give the command
format long g
and display v again.
The values in v are not 0: they are only 0 to 5 decimal places compared to the "1.0e+16 *" that you did not happen to notice at the top of your display of the content of v.
I recommand that you go into Preferences and permanently modify the preferred output format to be "long g"
  댓글 수: 2
Jongmin Paik
Jongmin Paik 2020년 3월 26일
Thanks for your helping!!
I want to know that 'long g' means.
Walter Roberson
Walter Roberson 2020년 3월 26일
longG: Long, fixed-decimal format or scientific notation, whichever is more compact, with a total of 15 digits for double values, and 7 digits for single values.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by