About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/reshape.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 reshape Context: slangrtl

Synopsis

Reshape an array

Syntax

reshape (Array_Type A, Array_Type I)

Description

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.

Example

If A is a 100 element 1-d array, it can be changed to a 2-d 20 by 5 array via

      reshape (A, [20, 5]);

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.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.