Re: Inverting Table

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue, 8 Sep 2009 14:46:10 -0600

Hi Cecille,
Assuming you have the data in an ascii file, say 'ascii-data.txt',
then you could
read it and reverse the order of the rows like this:

v = asciiread("ascii-data.txt",(/23,3/),"float")
vrev = v(::-1,:)

The step-size of -1 in the array subscripting of the first dimension
causes the order along the first dimension to be reversed.
See http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#Subscripts
  for a more complete discussion of NCL
subscripting.
  -dave

On Sep 8, 2009, at 1:01 PM, Cecille M. Villanueva Birriel wrote:

> Hi,
>
> I have this array:
>
> 37.23 -56.22 -90.44
> 53.11 -61.39 -87.83
> 70.06 -65.33 -85.41
> 83.88 -66.92 -83.43
> 95.57 -66.64 -81.66
> 109.32 -67.43 -79.07
> 125.49 -67.37 -75.10
> 144.52 -65.88 -69.88
> 166.90 -60.75 -62.46
> 193.24 -54.04 -54.94
> 224.22 -46.91 -47.53
> 260.66 -39.09 -40.32
> 303.54 -31.02 -33.83
> 353.99 -22.77 -29.02
> 413.33 -15.01 -24.69
> 483.15 -7.38 -18.37
> 557.78 0.43 -12.77
> 628.24 8.73 -9.16
> 689.83 16.27 -6.04
> 738.27 20.69 0.03
> 769.98 22.77 8.22
> 787.17 22.18 14.30
> -999.00 -999.00 -999.00
>
> I need to invert the table (-999.00 starting in the first line then
> 787.17 and on). How can this be done?
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Sep 08 2009 - 14:46:10 MDT

This archive was generated by hypermail 2.2.0 : Tue Sep 15 2009 - 16:03:21 MDT