How to avoid NaN when summing up vectors?

Hi,
Im trying to make some discrete integrals using trapz or even just using riemann sums, but I cant avoid getting NaN as a result. And the vector Im trying to integrate has no NaN values... Matlab can plot it perfectly without problems, values are well bounded but just cant sum up the total value.
Any help?

 채택된 답변

Sean de Wolski
Sean de Wolski 2011년 12월 1일

0 개 추천

You could use isnan to find the nans and delete them or interpolate over them.

추가 답변 (1개)

Raimundo De Mussy
Raimundo De Mussy 2011년 12월 1일

0 개 추천

nevermind, I found one damn NaN inside the vector I was trying to integrate. problem solved thx anyway

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by