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/max.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 max Context: slangrtl

Synopsis

Get the maximum value of an array

Syntax

result = max (Array_Type a [,Int_Type dim])

Description

The max function examines the elements of a numeric array and returns the value of the largest element. If a second argument is given, then it specifies the dimension of the array to be searched. In this case, an array of dimension one less than that of the input array will be returned with the corresponding elements in the specified dimension replaced by the minimum value in that dimension.

Example

Consider the 2-d array

      1       2       3       4       5
      6       7       8       9       10

generated by

      a = _reshape ([1:10], [2, 5]);

Then max(a) will return 10, and max(a,0) will return a 1-d array with elements

      6       7       8       9       10
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.