RESHAPE

Platform

x64, Win32, .NET

Purpose

To construct an array of a specified shape from the elements of a given array.

Class

Transformational function.

Syntax

FUNCTION RESHAPE(SOURCE, SHAPE [, PAD, ORDER])
INTEGER SHAPE, ORDER

Description

SOURCE is an array of any type. If PAD is present it is also an array of the same type and type parameters as SOURCE which is used to fill in any values that are missing from the end of SOURCE. PAD is used repeatedly if necessary.

SHAPE is an one-dimensional integer array with n values where 0 < n < 8. It gives the shape of the result (the number of elements along each dimension). If ORDER is present, it has the same shape as SHAPE and contains a permutation of the integers (1, 2, 3, . . ., n). The default is the natural order. ORDER is used to provide a permutation on the subscript order of the result.

Return value

The result is an array constructed from the elements of SOURCE and PAD using the shape given by SHAPE and ORDER.

Example

RESHAPE((/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /)) as the value .

RESHAPE((/ 1, 2, 3, 4, 5, 6 /), (/ 2, 4 /), (/ 0, 0 /), (/ 2, 1 /)) has the value .

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited