nanconvn

버전 1.0.0 (2.52 KB) 작성자: Fernando Zigunov
Convolution in N dimensions ignoring 'NaN' entries.
다운로드 수: 18
업데이트 날짜: 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