Im getting a NaN value for a 1334x2 double when I try to integrate with the trapz() function. Next I tried mean() out of good measure and it also returned NaN. Any thoughts? Data set too large?

댓글 수: 4

dpb
dpb 2019년 4월 30일
More like there's a NaN already in the data array you're unaware of because it's such a large array can't easily inspect every element.
Try (and report back) what
sum(isfinite(X))==numel(X)
and/or
sum(isnan(X))
return.
First will be logical T/F; second will actually be the number of NaN in the array...if first -->T then second will be zero and we'll have to dig deeper, but this is what the crystal (that has been on a roll recently) is saying...
Austin Swirsky
Austin Swirsky 2019년 4월 30일
So the first returned -> F (0)
The second returned -> 1
Does this mean there is one Nan value in the double?
dpb
dpb 2019년 5월 1일
Ayup...as suspected.
[r,c]=find(isnan(X))
will tell you the row, column containing it...
Now, what you do about it is all dependent upon what it means to have such and how you want to treat it...
Austin Swirsky
Austin Swirsky 2019년 5월 1일
Yes, I found it and have delt with it. Thank you for the help.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 NaNs에 대해 자세히 알아보기

제품

릴리스

R2017b

태그

질문:

2019년 4월 30일

댓글:

2019년 5월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by