nancumprod

버전 1.6.0.1 (2.41 KB) 작성자: Brett Shoelson
Compute the cumulative product of matrices, specifying the treatment of NaNs.
다운로드 수: 1.9K
업데이트 날짜: 2016/9/1

라이선스 보기

nancumprod: Cumulative product of a matrix, with user-specified treatment of NaNs.
Computes the cumulative product of matrix A along dimension DIM, allowing the user to replace NaNs with ones, or to maintain NaNs as placeholders.

USAGE: B = nancumprod(A, DIM, NMODE)

ARGUMENTS:

A: Input matrix.

B: Output cumulative product matrix, treating NaNs as determined by nmode.

DIM: B = nancumprod(A, DIM) returns the nan-cumulative product of the elements along the dimension of A specified by scalar DIM. For example, nancumprod(A,1) works down the columns, nancumprod(A,2) works across the rows. If DIM is not specified, it defaults to the first non-singleton dimension of A.

NMODE: specifies how NaNs should be treated. Acceptable values are:
1: REPLACE NaNs with ones (default).
2: MAINTAIN NaNs as position holders in B. (Skip NaNs without reset.)
3: RESET product to 1 on NaNs, replacing NaNs with ones.
4: RESET product to 1 on NaNs, maintaining NaNs as position holders.

See also: cumprod, nancumprod, nansum, nanmean, nanmedian, ...
(nancumsum is available from the FEX; other nan* functions may require Toolboxes)

인용 양식

Brett Shoelson (2024). nancumprod (https://www.mathworks.com/matlabcentral/fileexchange/14927-nancumprod), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
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.6.0.1

Updated license

1.6.0.0

Fixed a doc bug, and ensured R2014b readiness.

1.4.0.0

Fixes an issue with the vectorization of mode 3.

1.3.0.0

This submission fixes a bug found by a couple of attentive users. I have also added new options for treating NaNs, and eliminated (as unnecessary) special handling of vectors.

1.2.0.0

Updated M file and license text file copyright to The MathWorks, Inc.

1.1.0.0

added copyright

1.0.0.0

Fixing a typo i the description. No code change.