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!