Takes a one-D cut out of a two-D array
CUT | array=Realarray dimension=Integer index=Real | Takes a slice out of an array. |
example:
# Take a cuts at 1 and 1.5 along the 2nd dimension printn y >> y = Dimensions(2,3) >> fill y 1.0 1.0 >> printn cut(y, 1, 1.0) [1.0 2.0 3.0 ] Array(3 ) >> printn cut(y, 1, 1.5) [2.5 3.5 4.5 ] Array(3 )
Note: Returns a one-D array of one element if a one-D array is supplied.
The Cut() command takes a one dimensional slice out of a two dimensional array (useful in two dimensional graphics applications where a one dimensional plot is required along one axis). Depending on which dimension is chosen from the source array, the length of the resulting array is the length of the orthogonal dimension. The cut is taken at an index value along the dimension selected and the values of the resulting slice are linearly interpolated for this position of the index value.
Array (Realarray)
The array to be cut
Dimension (Integer)
Specifies the dimension along which the index position of the slice is specified.
RESULT = (Realarray)
The values along the orthogonal dimension, interpreted if necessary for a non-integer index value.