How to prevent an exponential function to return infinity
显示 更早的评论
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 个评论
Sandip Ghosal
2021-4-7
M=expm(vpa(2.9678e3))
Walter Roberson
2021-4-7
you do not need expm if you are passing in a symbolic scalar; just use exp()
采纳的回答
更多回答(1 个)
Sigitas Babraitis
2021-1-5
0 个投票
exp^inf
1 个评论
Walter Roberson
2021-4-7
not valid in MATLAB as exp must be passed an argument.
It is also not obvious how this would solve the problem?
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!