nanconv

버전 1.1.0.0 (2.75 KB) 작성자: Benjamin Kraus
Convolution in 1D or 2D ignoring NaNs and (optionally) correcting for edge effects.
다운로드 수: 2.5K
업데이트 날짜: 2013/5/28

라이선스 보기

NANCONV works by running 'conv2' 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.

C = NANCONV(A, K) convolves A and K, correcting for any NaN values
in the input vector A. The result is the same size as A (as though you
called 'conv' or 'conv2' with the 'same' shape).

C = NANCONV(A, K, 'param1', 'param2', ...) specifies one or more of the following:
'edge' - Apply edge correction to the output.
'noedge' - Do not apply edge correction to the output (default).
'nanout' - The result C should have NaNs in the same places as A.
'nonanout' - The result C should have ignored NaNs removed (default).
Even with this option, C will have NaN values where the
number of consecutive NaNs is too large to ignore.
'2d' - Treat the input vectors as 2D matrices (default).
'1d' - Treat the input vectors as 1D vectors.
This option only matters if 'a' or 'k' is a row vector,
and the other is a column vector. Otherwise, this
option has no effect.

인용 양식

Benjamin Kraus (2024). nanconv (https://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 NaNs에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Added "and (optionally) correcting for edge effects." to the summary. No change to the script.

1.0.0.0