Last change
on this file since 372 was
325,
checked in by pinsard, 17 years ago
|
modification of some headers (+some corrections) to prepare usage of the new idldoc
|
-
Property svn:keywords set to
Id
|
File size:
829 bytes
|
Rev | Line | |
---|
[133] | 1 | ;+ |
---|
[237] | 2 | ; @file_comments |
---|
[163] | 3 | ; Send back a vector or a matrix constituted of 0 and 1 in alternation |
---|
[133] | 4 | ; |
---|
[237] | 5 | ; @categories |
---|
[318] | 6 | ; Matrix |
---|
[133] | 7 | ; |
---|
[237] | 8 | ; @param n1 {in}{required} |
---|
| 9 | ; number of elements in the first dimension |
---|
[133] | 10 | ; |
---|
[237] | 11 | ; @param n2 {in}{required} |
---|
| 12 | ; number of elements in the second dimension |
---|
| 13 | ; |
---|
| 14 | ; @returns |
---|
| 15 | ; result |
---|
| 16 | ; |
---|
| 17 | ; @history |
---|
| 18 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[133] | 19 | ; 1/12/98 |
---|
| 20 | ; |
---|
[237] | 21 | ; @version |
---|
| 22 | ; $Id$ |
---|
[133] | 23 | ; |
---|
| 24 | ;- |
---|
[237] | 25 | FUNCTION zero_one, n1,n2 |
---|
[133] | 26 | ; |
---|
| 27 | compile_opt idl2, strictarrsubs |
---|
| 28 | ; |
---|
| 29 | CASE N_PARAMS() OF |
---|
| 30 | 1:return, findgen(n1) mod 2 |
---|
[237] | 31 | 2:BEGIN |
---|
[133] | 32 | if fix(n1/2) EQ n1/2. then BEGIN ;even number of columns |
---|
| 33 | res = findgen(n1+1,n2) mod 2 |
---|
| 34 | return, res[0:n1-1, *] |
---|
| 35 | ENDIF ELSE return, findgen(n1,n2) mod 2 ;odd number of columns |
---|
| 36 | END |
---|
| 37 | else: return, report('bad number of arguments') |
---|
[237] | 38 | endcase |
---|
[133] | 39 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.