Re: getting rid of repeated values in an array

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Nov 03 2009 - 11:01:37 MST

Hi,

I could have sworn we had a function for this. Since not, I've
attached a sample script that contains a function called "unique_vals".

The main code creates a dummy integer array, and then it uses your
sample array below.

Run with:

   ncl unq.ncl

--Mary


On Nov 3, 2009, at 10:03 AM, Trivej, Panu wrote:

> Hi,
>
> I would like to know if there is an NCL build-in function which
> performs this operation.
>
> Suppose I have an array:
>
> (/1,1,1,2,2,2,5,5,5,4,4/)
>
> It will get rid of repeated values and return
>
> (/1,2,5,4/)
>
> thank you.
>
>
> _______________________________________________
> 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 Nov 3 11:01:23 2009

This archive was generated by hypermail 2.1.8 : Fri Nov 06 2009 - 09:15:29 MST