EXPAND Function
Standard Library function that expands an array into higher dimensions.
Usage
result = EXPAND(a, d, i)
Input Parameters
a—An array of n dimensions.
d— A vector specifying the dimensions for the new array.
i—A monotonically increasing vector of n indices into d specifying which of the new dimensions correspond to old dimensions: d(i) must equal SIZE(a, /Dimensions).
Returned Value
result—An array of dimensions d, the expansion of the input array.
Keywords
None.
Examples
PM, EXPAND( [0,1], [2,3], [0] )
; PV-WAVE prints:
; 0 0 0
; 1 1 1
PM, EXPAND( [0,1], [3,2], [1] )
;PV-WAVE prints:
; 0 1
; 0 1
; 0 1
PM, EXPAND( [[0,1,2],[3,4,5]], [5,3,2], [1,2] )
; PV-WAVE prints:
; 0 1 2
; 0 1 2
; 0 1 2
; 0 1 2
; 0 1 2
;
; 3 4 5
; 3 4 5
; 3 4 5
; 3 4 5
; 3 4 5
PM, EXPAND( [[0,1,2],[3,4,5]], [3,5,2], [0,2] )
; PV-WAVE prints:
; 0 0 0 0 0
; 1 1 1 1 1
; 2 2 2 2 2
;
; 3 3 3 3 3
; 4 4 4 4 4
; 5 5 5 5 5
PM, EXPAND( [[0,1,2],[3,4,5]], [3,2,5], [0,1] )
; PV-WAVE prints:
; 0 3
; 1 4
; 2 5
;
; 0 3
; 1 4
; 2 5
;
; 0 3
; 1 4
; 2 5
;
; 0 3
; 1 4
; 2 5
;
; 0 3
; 1 4
; 2 5
See Also