Can anyone explain this output?

entering a matrix x=[3;9;4;5;2] then doing y=exp(x)
returns result of
1.0e+03 * <----- why this line?
0.0201 8.1031 0.0546 etc....
all of the values are correct but off by a factor of 3 (obviously from the first line)
I run this on another machine and DO NOT get "1.0e+03" as my first returned line and the answers come out correctly - the prefs are the same for both machines - but why the difference?

Respuestas (1)

José-Luis
José-Luis el 20 de Nov. de 2012
Editada: José-Luis el 20 de Nov. de 2012

1 voto

It's just because of the way the data is formatted for display.
doc format
Set the same format in the two machines if you want them to give the same display, e.g.:
format long
And that line is the multiplier;
exp(3) = 0.0201 * 1.0e+3 = 0.0201 * 1000 = 20.1

La pregunta está cerrada.

Etiquetas

Preguntada:

el 20 de Nov. de 2012

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by