Using fit function ignoring NaN

83 Ansichten (letzte 30 Tage)
Paola
Paola am 17 Mär. 2022
Kommentiert: Paola am 20 Mär. 2022
Hi,
how can I use the fit function ignoring the NaN values in my y vector?
Thanks
  1 Kommentar
Torsten
Torsten am 17 Mär. 2022
By removing them before calling the fit function.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Matt J
Matt J am 17 Mär. 2022
include=~isnan(y);
fobj = fit(x(include),y(include),fitType)

Weitere Antworten (0)

Kategorien

Mehr zu Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by