# cumavg {#cumavg}

## Syntax {#syntax}

`cumavg(X)`

Please see [Cumulative Window Functions](../Themes/cumFunctions.md) for the parameter description and windowing logic.

## Details {#details}

Calculate the cumulative average of *X*.

## Examples {#examples}

```
x=[2,3,NULL,4];
cumavg(x);
// output: [2,2.5,2.5,3]

m=matrix(1 2 3 NULL 4, 5 6 NULL 7 8);
m;
```

|\#0|\#1|
|---|---|
|1|5|
|2|6|
|3||
||7|
|4|8|

```
cumavg(m);
```

|\#0|\#1|
|---|---|
|1|5|
|1.5|5.5|
|2|5.5|
|2|6|
|2.5|6.5|

Related functions: [cummax](cummax.md), [cummin](cummin.md), [cumprod](cumprod.md), [cumPositiveStreak](cumPositiveStreak.md), [cumsum](cumsum.md)

