h = runstest(x)
h = runstest(x, v)
h = runstest(x, 'ud')
h = runstest(..., Name, Value)
[h, p, stats] = runstest(...)
runstest tests whether values in a vector appear in random order. The default test counts runs above and below the mean of x. A scalar v can be supplied as a reference value. The ud mode counts runs up and down.
Name-value arguments include Alpha, Method, and Tail. NaN values and values exactly equal to the reference are omitted.
x = [1 2 3 4 5 0 -1 -2];
[h, p, stats] = runstest(x)
| Version | Description |
|---|---|
| 2.0.0 | initial version |