pyyeti.ytools.mkpattvec¶
- pyyeti.ytools.mkpattvec(start, stop, inc)[source]¶
Make a pattern “vector”.
- Parameters:
start (scalar or array) – Starting value.
stop (scalar) – Ending value for first element in start (exclusive).
inc (scalar) – Increment for first element in start.
- Returns:
pattvec (array) – Has one higher dimension than start. Shape = (-1, start.shape).
Notes
The first element of start, stop, and inc fully determine the number of increments that are generated. The other elements in start go along for the ride.
Examples
>>> from pyyeti import ytools >>> import numpy as np >>> ytools.mkpattvec([0, 1, 2], 24, 6).ravel() array([ 0, 1, 2, 6, 7, 8, 12, 13, 14, 18, 19, 20]) >>> x = np.array([[10, 20, 30], [40, 50, 60]]) >>> ytools.mkpattvec(x, 15, 2) array([[[10, 20, 30], [40, 50, 60]], [[12, 22, 32], [42, 52, 62]], [[14, 24, 34], [44, 54, 64]]])