using fprintf with scientific notation

120 ビュー (過去 30 日間)
Samuel Trinidad-Espinoza
Samuel Trinidad-Espinoza 2018 年 2 月 27 日
回答済み: Voss 2023 年 12 月 26 日
What commands can I use to get +1.01325E+05 and 3.381400e+01? I know it involves %E and %e but i don't know in what order i should use them in.

回答 (1 件)

Voss
Voss 2023 年 12 月 26 日
x = 101325;
y = 33.814;
fprintf('%+.5E',x)
+1.01325E+05
fprintf('%+.6e',y)
+3.381400e+01

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by