resize

From DavinciWiki
Jump to: navigation, search


64-bit SafeYes

Description

Resize dimensions of array retaining number of elements. Please be careful. This function will actually modify the input array...even when you don't want it to...

Arguments and Return Values

Arguments: A numeric array and x, y and z values

Return Value: A numeric array of specified dimensions (reform the dimensions of an array)

Usage

Syntax: resize(obj = VAL, x = INT, y = INT, z = INT [, org = ORG])

The product of the new dimensions must equal to the product of the original dimensions. The resize() function cannot create or destroy elements it can only rearrange them.

Examples

dv> a
45x10x2 array of float, bsq format [3,600 bytes]

dv> b = resize(a,45,10,2)
45x10x2 array of float, bsq format [3,600 bytes]

dv> b = resize(a,45,20,1)
45x20x1 array of float, bsq format [3,600 bytes]

dv> b = resize(a,45,10,3)
Illegal dimensions: 45x10x3 != 900

Bad resize example

dv> out.normconc
3x75x53 array of float, bsq format [47,700 bytes]

dv> resize(out.normconc,1,1,3*75*53)
1x1x11925 array of float, bsq format [47,700 bytes]

dv> out.normconc
1x1x11925 array of float, bsq format [47,700 bytes]

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 11-05-2012

Personal tools