如果窗口中缺少大量原始数据点,则将 movmean 值设置为 NaN
我有一个一维数据文件,偶尔有 NaN 值。如果我将 movmean 应用于此输入数据,如果移动窗口内的输入值数量大于阈值,是否有一种简单的方法可以将 movmean 值设置为 NaN?例如,如果窗口长度为 10 并且阈值为 3,我希望这组 10 个值的 movmean 值为 NaN:
[1 3 NaN 4 NaN 2 5 NaN NaN 3]
但是请为我提供这组 10 个值的有效 movmean 值:
[1 3 2 4 NaN NaN 3 2 5 3]
I have a 1-d data file with occasional NaN values. If I apply movmean
to this input data, is there a simple way to set the movmean value to NaN if the number of input values within the moving window is greater than a threshold value? For example, if the window length is 10 and a threshold value is 3, I would like the movmean value to be NaN for this set of 10 values:
[1 3 NaN 4 NaN 2 5 NaN NaN 3]
but the give me a valid movmean value for this set of 10 values:
[1 3 2 4 NaN NaN 3 2 5 3]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个matlab问题,你可以这样做:
This is a matlab question, and you can do something like the following: