using fprintf with scientific notation

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.

Antworten (1)

Voss
Voss am 26 Dez. 2023

0 Stimmen

x = 101325;
y = 33.814;
fprintf('%+.5E',x)
+1.01325E+05
fprintf('%+.6e',y)
+3.381400e+01

Kategorien

Mehr zu Language Fundamentals finden Sie in Hilfe-Center und File Exchange

Tags

Beantwortet:

am 26 Dez. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by