I want to get the answer in decimal format...like x = 0.000015. Matlab shows it 1.5000e-05...

回答 (1 件)

Star Strider
Star Strider 2018 年 3 月 30 日

0 投票

See the documentation on the format (link) function.

4 件のコメント

Tausif Raza
Tausif Raza 2018 年 3 月 30 日
I am using format long and I get output for upto 4 digits after decimal but still when I input values less than 1 like x = 0.000015 matlab gives 1.500e-05
Star Strider
Star Strider 2018 年 3 月 30 日
Unless you want to write your own sprintf calls, format is the only option I know of.
Walter Roberson
Walter Roberson 2018 年 3 月 30 日
format long g
helps, but only up to 3 zeros before the first digit.
For smaller numbers, you need to sprintf() or fprintf()
Tausif Raza
Tausif Raza 2018 年 3 月 31 日
Ok thanks

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

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

質問済み:

2018 年 3 月 30 日

コメント済み:

2018 年 3 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by