[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can I de-loop?
- Subject: Re: Can I de-loop?
- From: R.G. Stockwell <dejastockwell(at)my-deja.com>
- Date: Thu, 15 Jul 1999 15:30:28 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: Deja.com - Share what you know. Learn what you don't.
- References: <7mje9s$263$1@nnrp1.deja.com>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:15684
In article <7mje9s$263$1@nnrp1.deja.com>,
throop@colorado.edu wrote:>For instance, given
>
>A = [0,1,2]
>N = [2,2,2]
>K = 4
>
>I want the result A = [0,1,14], not A = [0,1,6]
I'll take this one guys (using the non-gender-specific meaning!).
Woohoo! My first "use histogram" posting!
A = [0,1,2]
N = [2,2,2]
n = n(sort(n)) ; you may need this, not sure of your application
K = 4
print,a
a =a+k*histogram(n,binsize=1,min=0,max=n_elements(a)-1)
print,a
This may not be general enough for your application, but
you get the idea. Always use histogram if possible.
Cheers,
bob
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.