Error with fillmissing syntax

조회 수: 18 (최근 30일)
Farbos de Luzan
Farbos de Luzan 2020년 12월 9일
편집: Farbos de Luzan 2020년 12월 11일
Hello,
I have a simple 274x108 matrix A with numbers and NaNs.
I want to replace the Nans with interpolated values using fillmissing.
I would like to use the parameter 'MaxGap' — Maximum gap size to fill.
dim = 1;
[F,TF] = fillmissing(A,'linear',dim,'MaxGap',2);
No matter how I try to use it, it returns:
Error using fillmissing/parseInputs (line 455)
Fill method must be 'constant', 'previous', 'next', 'nearest', 'linear', 'spline', 'pchip',
'makima', 'movmean', or 'movmedian'.
How do you use the MaxGap parameter?
Thank you in advance!
Charles
  댓글 수: 6
Adam Danz
Adam Danz 2020년 12월 11일
MaxGap wasn't an option prior to r2020b
Here's documentation for 20a and that parameter isn't mentioned
Farbos de Luzan
Farbos de Luzan 2020년 12월 11일
Thank you Adam.
Sometimes I read the documentation online as it feels more convenient to navigate, and I didn't notice this parameter was not available in my release's doc.

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

채택된 답변

Farbos de Luzan
Farbos de Luzan 2020년 12월 11일
편집: Farbos de Luzan 2020년 12월 11일
Just installed r2020b.
It works now.
As Adam said:
MaxGap wasn't an option prior to r2020b

추가 답변 (1개)

Farbos de Luzan
Farbos de Luzan 2020년 12월 11일
Adam,
The function stopped at line 455 when I tried
[F,TF] = fillmissing(A,'MaxGap',0.1);
which was a syntax error I admit.
With the syntax used here
[F,TF] = fillmissing(A,'linear','MaxGap',2);
the function stops at line 127
Error using fillmissing/parseInputs (line 538)
Parameter name must be 'EndValues', 'SamplePoints', or 'DataVariables'.
Error in fillmissing (line 127)
[A,AisTable,intM,intConstOrWinSize,extM,x,dim,dataVars,ma] =
parseInputs(A,fillMethod,varargin{:});
Should I try to install R2020b?

카테고리

Help CenterFile Exchange에서 Data Preprocessing에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by