Inf problem
조회 수: 4 (최근 30일)
이전 댓글 표시
I'm working on video, and have alot of computations in my processes. in one part i divide a number on another one, but I receive wrong result.
for example:
1.000000000000000e-03/ 1.000000000000000e-03+ 0
ans
=Inf
how can i handle this?
I use format short, but it doesn't help me.
please help
댓글 수: 0
채택된 답변
Arnaud Miege
2011년 8월 2일
You probably want (note the brackets):
m12 = deltaR12 / (min(deltaRF(ii, jj, tt), deltaRF_V(ii, jj, tt)) + epsilon);
Your code, as is divides deltaR12 by min(..,..), and then adds epsilon to the result of the division, which I suspect is not what you want.
HTH,
Arnaud
댓글 수: 4
Walter Roberson
2011년 8월 2일
Ever since Mr. D. Adams (RIP), suppliers have been demanding a share of intellectual property rights for everything that is powered by a Nice Hot Cup Of Tea.
추가 답변 (1개)
Walter Roberson
2011년 8월 1일
Please copy the exact code that reproduces this on your system. It appears that the denominator on the division is becoming 0, which could perhaps happen due to the exact spacing you use.
Also, I suggest you try
format short g
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!