mean of a set of data

if we have the mean of a set of numbers, we can find the standard deviation. is there a command in matlab, ie, a parameter to compare the data of a mean closed curve with the data of all the original closed curves. something like the satandard deviation for this case...
imagine i have
3 2 4
2 3 7
4 2 3
the mean
3
4
3
and then some parameter like standard deviation, that is not applicable for this case of course
thank you

Respuestas (1)

Walter Roberson
Walter Roberson el 28 de Nov. de 2012

0 votos

M = mean(YourArray, 2); %calculate the means
T = repmat(M, 1, size(YourArray2)); %replicate the means
T < YourArray %compare the mean with all of the data

9 comentarios

joo
joo el 28 de Nov. de 2012
i am sorry i didn t understand... can you explain?
Image Analyst
Image Analyst el 28 de Nov. de 2012
Did you try it:
YourArray=[...
3 2 4
2 3 7
4 2 3 ]
M = mean(YourArray, 2) %calculate the means
T = repmat(M, 1, size(YourArray,2)) %replicate the means
T < YourArray %compare the mean with all of the data
M =
3
4
3
T =
3 3 3
4 4 4
3 3 3
ans =
0 0 1
0 0 1
1 0 0
joo
joo el 28 de Nov. de 2012
i am sorry but this is not what i mean. imagine you have many separate circles. i got the average circle. now i want something like the stdrd deviation (used for a set of numbers) to characterize this mean(that here is impossible, but it must exist some *parameter *i cant remember). am i clear?
Walter Roberson
Walter Roberson el 28 de Nov. de 2012
How does your data array encode the circles?
If your data array is a image of circles, convert it to binary, label that, and then regionprops that result looking at measures such as Eccentricity and axis lengths.
Tom Lane
Tom Lane el 28 de Nov. de 2012
Or maybe your array C is a set of points on the circle? You could compute the mean M of those points, then the average distance from the points to M. In that case the pdist2 function from the Statistics Toolbox might help, but it would be simple enough to write out an expression for the distance in 2 or 3 dimensions.
joo
joo el 28 de Nov. de 2012
tom lane, i think is that. but first i dont have circles, i have closed curves. then lets imagine the 4 curves come from 2 3 4; 2 3 4; 2 5 6; 5 5 7. the data of the mean curve is 1 2 3.
having this imaginary data (with no sense at all). can you explain better your idea. i understood the idea of distances but... can you explain better the exacution please. thank you so much.
Walter Roberson
Walter Roberson el 29 de Nov. de 2012
Are you trying to calculate the centroid of the list of points? Are you trying to calculate the Euclidean distance of each point to the centroid of the list? Are you trying to calculate the standard deviation of the Euclidean distances of each point to the centroid of the list ?
Image Analyst
Image Analyst el 29 de Nov. de 2012
Joo, you need to explain this more completely from the start. It's like each time you add just another small but incomplete part of the puzzle. It's like you want an elephant detector, and then you ask us how to measure gray color, and not mention that you want to detect elephants. So we tell you only how to measure gray, and then you say that it doesn't work because it calls a wolf an elephant (but you don't tell us that fact - why it doesn't work). Well, if all you wanted was to measure gray, then that's what we gave you, and then of course it will also detect a wolf because it's gray too. Then you ask us to give you something that detect gray but no hair, and so we add a "hair detector" to tell wolves and elephants apart still without knowing you want an elephant detector. All we know is that you told us gray and no hair. But we may have to suggest more modifications when you come back and tell us that it's still not working but neglect to tell us that the reason it doesn't work is because it now classifies rhinoceroses as elephants. The point is that if you just tell us parts of the puzzle you will get only partial, sub-optimal answers.
First you just want the mean and standard deviation of an array. Then we learn that they numbers in it represent some kind of noisy samples of the boundary of circles. Well, okay we could then find the centroid and calculate the mean radius of the wiggly circles and the standard deviation of the radii. But I'm not even sure that's what you want or need because you haven't given us the full story. For example let's say you want to discriminate sickle cells from normal round red blood cells, and you think that the way to do that is to find boundary points and get the standard deviation of the center-to-boundary distance as you move around the boundary. Well, there's an easier way to do that (ask regionprops for the eccentricity) but we won't know to suggest that because you have not told us the real, final thing that you want to do or measure - you've only told us some algorithm that you think might be best. But it may not be the best way and you could take advantage of hundreds if not thousands of years of image processing experience in this community if you just told the community what you really want to do.
Walter Roberson
Walter Roberson el 29 de Nov. de 2012
Heh. Mind you, I did suggest regionprops eccentricity earlier ;-)

Iniciar sesión para comentar.

Categorías

Más información sobre Just for fun en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

joo
el 28 de Nov. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by