Using fit function ignoring NaN

조회 수: 54 (최근 30일)
Paola
Paola 2022년 3월 17일
댓글: Paola 2022년 3월 20일
Hi,
how can I use the fit function ignoring the NaN values in my y vector?
Thanks
  댓글 수: 1
Torsten
Torsten 2022년 3월 17일
By removing them before calling the fit function.

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

채택된 답변

Matt J
Matt J 2022년 3월 17일
include=~isnan(y);
fobj = fit(x(include),y(include),fitType)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by