Home Up Next

Subchapters:

Arr1
Arr2
Arr3
Arr4
Arr5
Arr6
Arr7
Exercices arrays

Working with arrays

 

One of the things IDL is able to do is working with arrays very nicely.
First, let's define some arrays:

        IDL> vec1 = [1,2,3,4,3,2,3,4,5,5,3]
        IDL> vec2 = [8,65,7,54,3,4,6,7,6,5,5]
        IDL> tab1 = [  [ 1.5 , 2 , 3 ] , [ 2 , 3 , 4 ] , [ 7 , 9 , 0 ] ]

this latest one is a 2D array.

Arrays are in the [ column , row ] order. 

 Arrays start at 0!!!

=> the 5th column of tab[N,M] is tab[4,*]

There is a large set of other array-oriented arithmetic functions, such as expand, mean, rebin, reverse, smooth, sort, total, transpose, and so forth.

 

IDL courses C. Morisset © 2004 IA/UNAM V 2.2

Home Up Next