Borrar filtros
Borrar filtros

Using fit function ignoring NaN

124 visualizaciones (últimos 30 días)
Paola
Paola el 17 de Mzo. de 2022
Comentada: Paola el 20 de Mzo. de 2022
Hi,
how can I use the fit function ignoring the NaN values in my y vector?
Thanks
  1 comentario
Torsten
Torsten el 17 de Mzo. de 2022
By removing them before calling the fit function.

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 17 de Mzo. de 2022
include=~isnan(y);
fobj = fit(x(include),y(include),fitType)

Más respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by