Using fit function ignoring NaN

Hi,
how can I use the fit function ignoring the NaN values in my y vector?
Thanks

1 Comment

By removing them before calling the fit function.

Sign in to comment.

 Accepted Answer

include=~isnan(y);
fobj = fit(x(include),y(include),fitType)

More Answers (0)

Categories

Asked:

on 17 Mar 2022

Commented:

on 20 Mar 2022

Community Treasure Hunt

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

Start Hunting!