function col,variable ;The function col.pro finds the number of columns in a matrix. ;Use is as follows: ; c=col(x) ;Where ; x = matrix that # of columns is desired ; ; c = # of columns of matrix x ; ;Related code: row.pro, siz.pro ; ;BWBerger 3/5/99 ; ;***Note that for row vectors, the # of columns is the same as the length. s=size(variable) if s(0) eq 0 then begin columns=1 endif else begin columns=s(1) endelse if (s(0) eq 3) then begin print,'Array is 3-D. Col returns # of columns.' endif return, columns end