Borrar filtros
Borrar filtros

exp(A) gives zero in the first argument

3 visualizaciones (últimos 30 días)
Antonios Nasioulas
Antonios Nasioulas el 19 de Oct. de 2019
Comentada: Star Strider el 19 de Oct. de 2019
When I compute for example
exp([71 307])
on matlab (on my laptop version) I get
ans =
1.0e+133 *
0.0000 2.1301
Which seems pretty unreasonable to me as 71 is not that big and of course not bigger than 307.
Also if I put the same computation on octave online I get
ans =
6.8377e+30 2.1301e+133
which makes tottaly sense.
Do you know what is going wrong?

Respuesta aceptada

Star Strider
Star Strider el 19 de Oct. de 2019
Try this:
format longE
exp([71 307])
producing:
ans =
6.837671229762744e+30 2.130129192828224e+133
See the documentation on format for more information.
  2 comentarios
Antonios Nasioulas
Antonios Nasioulas el 19 de Oct. de 2019
Yes, this works.
But is there a bug on my version or what happens and I get this odd result?
Star Strider
Star Strider el 19 de Oct. de 2019
There is no bug. The default format is short. You can change it in the Preferences to something else, or change it specifically for one calculation or a set of calculations as I did here, then (if you want to), change it back to a previous definition. The chosen format will be whatever you chose for it when you start MATLAB, and if you change it, the change will remain until you change it to something else. See the documentation I linked to for details.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Naming Conventions en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by