[Thread Prev][Thread Next][Index]
Re: list the data in the reverse order (corrected)
On Sun, 6 Feb 2005, Namba Takaya wrote:
> I would like to list the data in the reverse order.
> According to a previous mail, I made it using repeat command like
> repeat/j=1:570
> (list/clobber/order=ij/file=reverse.txt/nohead/format=(343(f7.2,2x))
> sst[i=-227:115,j=`1140-j`])
Hi Namba Takaya,
I don't know how to do it with a qualifier, but the "sample"
functions provide one of probably several ways to reverse order.
For example:
def axis/x=1:9:2 xax ; def axis/y=2:16:2 yax
def grid/x=xax/y=yax grd
let v=i[g=grd]^2+j[g=grd]
list v
! SUBSET : 5 by 8 points (X-Y)
! 1 3 5 7 9
! 1 2 3 4 5
! 2 / 1: 2.00 5.00 10.00 17.00 26.00
! 4 / 2: 3.00 6.00 11.00 18.00 27.00
! 6 / 3: 4.00 7.00 12.00 19.00 28.00
! 8 / 4: 5.00 8.00 13.00 20.00 29.00
! 10 / 5: 6.00 9.00 14.00 21.00 30.00
! 12 / 6: 7.00 10.00 15.00 22.00 31.00
! 14 / 7: 8.00 11.00 16.00 23.00 32.00
! 16 / 8: 9.00 12.00 17.00 24.00 33.00
! Now suppose we want to list the array in reversed j order
! over the range i=2:4, j=7,6,5,4,3. We could use
list/form=(3f6.1)/nohead/i=2:4 samplej(v,10-j[j=3:7])
! 11.0 16.0 23.0
! 10.0 15.0 22.0
! 9.0 14.0 21.0
! 8.0 13.0 20.0
! 7.0 12.0 19.0
Good luck,
Mick
PS I don't understand the use of the negative "i" index in your
example sst[i=-227:115,j=`1140-j`])
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement