Subject: Re: Median of an array - msg#00207
List: java.imagej
On Wednesday 27 July 2005 10:47, Pedro Ramos wrote:
>
I would like to calculate the median of an array in a plugin, and I haven't
>
found a way to do it by browsing through the stored messages posted in the
>
mailing list. Can anyone tell me how to calculate the median of an array in
>
a plugin. Thanks a lot.
Sort the array of n elements, then
take the middle value if n=odd
take the average of the 2 middle values if n=even
Cheers,
G.
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Median of an array
Dear all,
I use to manage well things when doing macros, but I am completely lost when
I have to work with plugins. So I'll appreciate some help.
I would like to calculate the median of an array in a plugin, and I haven't
found a way to do it by browsing through the stored messages posted in the
mailing list. Can anyone tell me how to calculate the median of an array in
a plugin. Thanks a lot.
Pedro
Next Message by Date:
click to view message preview
Re: Median of an array
Ok, that is the way to calculate the median of an array, I know that. I was
wondering if there is a command to do it automatically without programming
the whole process you have described. But thanks anyhow for your help.
That's how I'll proceed if I can't find a "shortcut".
Pedro
Previous Message by Thread:
click to view message preview
Median of an array
Dear all,
I use to manage well things when doing macros, but I am completely lost when
I have to work with plugins. So I'll appreciate some help.
I would like to calculate the median of an array in a plugin, and I haven't
found a way to do it by browsing through the stored messages posted in the
mailing list. Can anyone tell me how to calculate the median of an array in
a plugin. Thanks a lot.
Pedro
Next Message by Thread:
click to view message preview
Re: Median of an array
Ok, that is the way to calculate the median of an array, I know that. I was
wondering if there is a command to do it automatically without programming
the whole process you have described. But thanks anyhow for your help.
That's how I'll proceed if I can't find a "shortcut".
Pedro