Fillmissing function with movmean

1 回表示 (過去 30 日間)
Lewis Waswa
Lewis Waswa 2022 年 6 月 14 日
回答済み: Steven Lord 2022 年 6 月 14 日
I have a set of data with NaNs. So I filled the NaNs useing the fillmissing function. However, while the final array does not have NaNs in it, any mathematical computation performed on it returns NaN. What could be the problem?
Thanks

回答 (1 件)

Steven Lord
Steven Lord 2022 年 6 月 14 日
Operations involving NaN as one of the operands is one common way to get a NaN in the output, but it is not the only way. See Wikipedia for a list of other operations that can generate a NaN. If all your data is finite, likely you computed 0/0.
x = 0/0
x = NaN
There are more ways to generate a NaN if infinity gets involved (such as if your calculations overflow.)
[0*Inf, Inf-Inf, Inf/Inf, rem(Inf, 0)]
ans = 1×4
NaN NaN NaN NaN

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by