Changeset 237 for trunk/SRC/Matrix/zero_one.pro
- Timestamp:
- 03/26/07 17:37:03 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Matrix/zero_one.pro
r231 r237 1 1 ;+ 2 ; @file_comments 2 ; @file_comments 3 3 ; Send back a vector or a matrix constituted of 0 and 1 in alternation 4 4 ; 5 ; @categories 5 ; @categories 6 6 ; Function, Matrix 7 7 ; 8 ; @param n1 {in}{required} number of elements in the first dimension9 ; @param n2 {in}{required} number of elements in the seconddimension8 ; @param n1 {in}{required} 9 ; number of elements in the first dimension 10 10 ; 11 ; @returns result 12 ; 13 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 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) 14 19 ; 1/12/98 15 20 ; 16 ; @version $Id$ 21 ; @version 22 ; $Id$ 17 23 ; 18 24 ;- 19 25 ; 20 functionzero_one, n1,n226 FUNCTION zero_one, n1,n2 21 27 ; 22 28 compile_opt idl2, strictarrsubs … … 24 30 CASE N_PARAMS() OF 25 31 1:return, findgen(n1) mod 2 26 2:BEGIN 32 2:BEGIN 27 33 if fix(n1/2) EQ n1/2. then BEGIN ;even number of columns 28 34 res = findgen(n1+1,n2) mod 2 … … 31 37 END 32 38 else: return, report('bad number of arguments') 33 endcase 39 endcase 34 40 end
Note: See TracChangeset
for help on using the changeset viewer.