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!