Using the findchangepts function on data containing NaN datapoints

조회 수: 7 (최근 30일)
Impala
Impala 2020년 3월 23일
답변: tara es 2022년 5월 12일
Hi,
My data contains NaN datapoints, so when I use the findchangepts function, I get the following error message:
xError using findchangepts
Expected input number 1, X, to be finite.
Error in findchangepts>getargs (line 166)
validateattributes(x,{'single','double'},{'real','2d','nonsparse','finite'}, ...
Error in findchangepts (line 99)
[statistic, Kmax, Lmin, penalty] = getargs(x, varargin);
Is there a way to use the findchangepts function on data containing NaN datapoints?
If not, is there someway for me to transform my data so the findchangepts function can accept it without any errors?
Thanking you in advance!

답변 (2개)

Samatha Aleti
Samatha Aleti 2020년 3월 26일
You may remove NaN values from your "data" and then call “findchangepts” function with this "data". You can remove NaN values from your “data” as follows:
data = data(~isnan(data))
  댓글 수: 1
Impala
Impala 2020년 3월 26일
Hi,
Thank you for your help.
If I remove the NaN values, the length of my data will reduce. I need to keep the length the same. Is there another way around this?
Many thanks once again.

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


tara es
tara es 2022년 5월 12일
you can use fillgaps function for fill NAN values (GAPs), without reduce the length of data. It can help you.
y = fillgaps(data)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by