How to avoid NaN when summing up vectors?

8 ビュー (過去 30 日間)
Raimundo De Mussy
Raimundo De Mussy 2011 年 12 月 1 日
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 日
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 日
I did! Thanks

サインインしてコメントする。

その他の回答 (1 件)

Raimundo De Mussy
Raimundo De Mussy 2011 年 12 月 1 日
nevermind, I found one damn NaN inside the vector I was trying to integrate. problem solved thx anyway

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by