Using fit function ignoring NaN

134 visualizzazioni (ultimi 30 giorni)
Paola
Paola il 17 Mar 2022
Commentato: Paola il 20 Mar 2022
Hi,
how can I use the fit function ignoring the NaN values in my y vector?
Thanks
  1 Commento
Torsten
Torsten il 17 Mar 2022
By removing them before calling the fit function.

Accedi per commentare.

Risposta accettata

Matt J
Matt J il 17 Mar 2022
include=~isnan(y);
fobj = fit(x(include),y(include),fitType)

Più risposte (0)

Categorie

Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by