reshape (Array_Type A, Array_Type I)
The reshape function changes the size of A to have the size
specified by the 1-d integer array I. The elements of I
specify the new dimensions of A and must be consistent with
the number of elements A.
If A is a 100 element 1-d array, it can be changed to a
2-d 20 by 5 array via
However, reshape(A, [11,5]) will result in an error because
the [11,5] array specifies 55 elements.
Since reshape modifies the shape of an array, and arrays are
treated as references, then all references to the array will
reference the new shape. If this effect is unwanted, then use the
_reshape function instead.
- slangrtl
-
_reshape,
_typeof,
array_info,
array_map,
get_struct_field,
length,
max,
min,
set_struct_field,
sum,
transpose,
typeof,
where
|