Converting a real number to scientific format

I'm not sure how to start this problem with Matlab...
Write a program that accepts a real number and displays the number in scientific format “x.xxxEn”. For example 2546 would be displayed as 2.546000e+003
How would the mod function be of use for this?

1 Kommentar

Walter Roberson
Walter Roberson am 12 Mär. 2012
The example disagrees with the question. The question requires three places after the decimal point, but the example shows 6 places after the decimal point.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sean de Wolski
Sean de Wolski am 12 Mär. 2012

0 Stimmen

doc fprintf
I don't really see any use for mod.

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 12 Mär. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by