You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
>> Y = cummean(X,DIM);
if X is MxN, Y is also MxN. To illustrate the functionality, lets assume X is a 1xN vector. Then, Y is a 1xN vector where the n-th entry in Y is given by mean(X(1:n)). So, Y(end) = mean(X), and Y(1) = X(1). cumvar works in the same way, and this can be done on an arbitrary dimensional X along dimension DIM. See screenshot for an example.
These functions are useful (at least to me) for determining how many iterations of a process are required until the mean and variance of the process are stable (ie: not changing with increasing iterations). Maybe useful to people doing Markhov chain stuff?
Cite As
Sumedh Joshi (2026). Cumulative Mean and Variance (https://www.mathworks.com/matlabcentral/fileexchange/26791-cumulative-mean-and-variance), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (1.79 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
