Re: How to print out column number using write_matrix function

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 21 May 2007 14:05:07 -0600

Guangshan chen wrote:
> Dear all,
>
> Is there a way to print out column number when using write_matrix
> function to output ASCII file?
>
> Guangshan
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Sorry .... no. Only row numbers.

I don't know the type [float, integer, ..] of the data.
If it is just column numbers may you could try ...

Let data(nrow,mcol)

      dimd = dimsizes( data )
      dimd(0) = dimd(0) + 1 ; one extra row to contain col numbers

      DATA = new (dimd, typeof(data) )
      DATA(0,:) = ispan(1,dimd(1),1) ; column numbers
      DATA(1:,:) = data

      write_matrix (DATA,...)

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 21 2007 - 14:05:07 MDT

This archive was generated by hypermail 2.2.0 : Tue May 29 2007 - 07:20:15 MDT