comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Finding the index of the median
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Finding the index of the median [message #7349 is a reply to message #7268] Tue, 29 October 1996 00:00 Go to previous messageGo to previous message
daffer is currently offline  daffer
Messages: 9
Registered: October 1996
Junior Member
In article <32769981.73B9@cassini.lpl.arizona.edu>,
Dean Schulze <schulze@cassini.lpl.arizona.edu> wrote:
> Joseph M. Zawodny wrote:
>>
>> Dean Schulze wrote:
>>>
>>> David Fanning wrote:
>>>
>>>> Be aware that there can be multiple locations in your
>>>> array that are equal to the median value. The index that
>>>> is returned by the WHERE function will be an array of
>>>> all of those values.
>>>
>>> That is exactly why the WHERE() function won't work.
>>> I need to know which one of those locations is returned
>>> by the MEDIAN() function.
>
>> MEDIAN does not return an element or LOCATION, it returns a
>> VALUE which may be held by one or more elements.
>
> Sorry, careless writing on my part. I should have said
> "I need to know the location of the value that is returned
> by MEDIAN()".
>
>

( snipped to save space )

>
> An unusual situation, but one that MEDIAN() and WHERE() don't
> seem to work with.
>
>
> Dean Schulze
>

Dean
Implement your own median


let data = your data
noise = associated noise array
n = n_elements( data )
s = sort(data )
median = data(s(n/2))
associated_noise_value = noise(s(n/2))
This is pretty much what median does.

I think that does it.
Let me know if I'm wrong.
WHD
--
------------------------------------------------------------ -------------------
William Daffer __ __ ____ ___ ___ ____
daffer@primenet.com /__)/__) / / / / /_ /\ / /_ /
/ / \ / / / / /__ / \/ /___ /
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A Nice (undocumented?) feature for PS plotting
Next Topic: Slicer & Colors

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:57:52 PDT 2025

Total time taken to generate the page: 1.11793 seconds