1. Inserting a Sequence of Values
mtxSeries(n, x, [step])
Generates a column vector (a one‑column matrix) containing n subsequent numbers or date/time strings.
The x argument specifies the first element of the series. It may be a number or a date/time string.
The optional step argument specifies the increment applied to each subsequent element.
- If omitted for numeric series, step = 1.
- If omitted for date/time series, step = "P1D" (one day).
Date/Time Period Format
Date/time increments use ISO‑8601 duration format:
[+|-]PnYnMnDTnHnMnS.nnn
Examples:
- P1Y2M10DT11H5M4S.355 → 1 year, 2 months, 10 days, 11 hours, 5 minutes, 4 seconds, 355 milliseconds
- PT12H7M → 12 hours and 7 minutes
Examples
=mtxSeries(5, 1, 0.1)
returns {1; 1.1; 1.2; 1.3; 1.4}
=mtxSeries(5, "2005-12-01", "P1D")
returns {"2005-12-01"; "2005-12-02"; "2005-12-03"; "2005-12-04"; "2005-12-05"}
=mtxSeries(5, "12:50:00", "PT2M")
returns {"12:50:00"; "12:50:02"; "12:50:04"; "12:50:06"; "12:50:08"}
2. Inserting a Random Series
mtxRand2(n, [seed1], [seed2], [type], [v1], [v2])
Generates a column vector (a one‑column matrix) of random floating‑point numbers according to the specified distribution type.
2.1 Arguments
- n — number of random values to generate.
-
seed1, seed2 — initial seeds for the two MLCG generators.
- If both seeds are omitted, the first call uses fixed internal seeds; subsequent calls continue the sequence.
- If both seeds are specified, the same random sequence is generated every time.
- To generate independent sequences, specify seed1 and omit seed2.
-
type — distribution type:
- 0 — uniform (0, 1)
- 1 — normal distribution (mean = v1, stddev = v2)
- 2 — exponential distribution (mean = v1)
- 3 — Poisson distribution (mean = v1)
- 4 — Bernoulli distribution (probability = v1)
- 5 — geometric distribution (probability = v1)
- v1, v2 — parameters required by some distributions. If a distribution does not require them, they must be omitted.
2.2 Example
=mtxRand2(4, 10000, 25000,,,)
returns {0.71261246808435; 0.28457538373252; 0.42105025462307; 0.93072516522912}