A numerical calculation problem leading to Inf or NaN in matlab
I want to calculate the exact value of , where and is a very large positive number. Obviously, we have the bound ,and therefore .
However, in reality, for example, if , due to the large , we have and the matlab will treat it as 0 and .
On the other hand, if , due to the large , we have a very large and matlab will treat the sum as Inf and . So how to avoid the above two cases and get the exact value of F in matlab?I want to calculate the exact value of , where and is a very large positive number. Obviously, we have the bound ,and therefore .
However, in reality, for example, if , due to the large , we have and the matlab will treat it as 0 and .
On the other hand, if , due to the large , we have a very large and matlab will treat the sum as Inf and . So how to avoid the above two cases and get the exact value of F in matlab? I want to calculate the exact value of , where and is a very large positive number. Obviously, we have the bound ,and therefore .
However, in reality, for example, if , due to the large , we have and the matlab will treat it as 0 and .
On the other hand, if , due to the large , we have a very large and matlab will treat the sum as Inf and . So how to avoid the above two cases and get the exact value of F in matlab? numerical calculation, nan MATLAB Answers — New Questions