How to use tan(X) in matlab
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
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
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 件のコメント
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 Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!