nanconvn

Convolution in N dimensions ignoring 'NaN' entries.
ダウンロード: 16
更新 2020/3/26

ライセンスの表示

FULL CREDIT FOR THE DEVELOPMENT OF THIS CODE TO BENJAMIN KRAUS (2013). I expanded his Matlab Exchange entry (https://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv) to allow for N dimensions.

Below follows Benjamin Kraus' explanation of how this code works. I decided to transcribe it here, since he did such a great job!

NANCONVN runs CONVN either two or three times. The first time is run on the original input signals A and K, except all the NaN values in A are replaced with zeros. The 'same' input argument is used so the output is the same size as A. The second convolution is done between a matrix the same size as A, except with zeros wherever there is a NaN value in A, and ones everywhere else. The output from the first convolution is normalized by the output from the second convolution. This corrects for missing (NaN) values in A, but it has the side effect of correcting for edge effects due to the assumption of zero padding during convolution. When the optional 'noedge' parameter is included, the convolution is run a third time, this time on a matrix of all ones the same size as A. The output from this third convolution is used to restore the edge effects. The 'noedge' parameter is enabled by default so that the output from 'nanconv' is identical to the output from 'conv2' when the input argument A has no NaN values.

引用

Fernando Zigunov (2024). nanconvn (https://www.mathworks.com/matlabcentral/fileexchange/74721-nanconvn), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2018b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
タグ タグを追加

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0