How to prevent an exponential function to return infinity
Mostrar comentarios más antiguos
Hello everybody
I currently try to simulate the performance of a portfolio and have - at some points - to deal with very high numbers. This works fine as long as I dont feed an exponential function since the return value is then Inf.
e.g. exp(x) where x = 2.9678e+03.
Can I somehow chance the configuration of the exp function such that it returns real numbers even if I feed the function with high values?
Best, Clemens
2 comentarios
Sandip Ghosal
el 7 de Abr. de 2021
M=expm(vpa(2.9678e3))
Walter Roberson
el 7 de Abr. de 2021
you do not need expm if you are passing in a symbolic scalar; just use exp()
Respuesta aceptada
Más respuestas (1)
Sigitas Babraitis
el 5 de En. de 2021
0 votos
exp^inf
1 comentario
Walter Roberson
el 7 de Abr. de 2021
not valid in MATLAB as exp must be passed an argument.
It is also not obvious how this would solve the problem?
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!