Using fit function ignoring NaN

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 日

3 投票

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

1 件のコメント

Paola
Paola 2022 年 3 月 20 日
Thanks! it worked

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2022 年 3 月 17 日

コメント済み:

2022 年 3 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by