how to change the histogram to the vector?

how to prove the histogram can be changed in the form of a vector?

 Accepted Answer

The histogram is normally already a vector of counts - the frequency of occurrence of values in your data. Nothing to convert - it's already a vector.
[counts values] = hist(data); % counts is a vector.

2 Comments

thank you. but, if the probability histogram is a vector? because I need to measure the similarity vector with one minus the correlation coefficient method.
What similarity vector is that?

Sign in to comment.

More Answers (1)

You could create a histogram plot, and then go into the resulting barseries object and retrieve the YData from that object, and compare it to the original counts, and then use that retrieved set of counts to create a second histogram that will then look just like the first. The fact that the vector of data contains enough information to recreate the histogram plot will establish that the histogram can be converted to the vector.

10 Comments

thank you. I use vectors to calculate the similarity by using one minus the correlation coefficient of the two images with the histogram. is there any other solution of this problem?
I'm not sure what that means. Do you have a formula for it?
I create an image by using the identification method. steps are to change the image in the form of grayscale image and create a histogram, and then calculated the distance function method one minus correlation coefficient. (I have not made a formula of the distance function method). I need your help.
What part are you asking for assistance with?
how the formula for calculating one minus correlation coefficient methods from histogram in matlab GUI?
pBar = mean2(image1);
qBar = mean2(image2);
I think you can figure out the rest.
thank you,, I tried to solve it.
In the formula you show, what is the dot operator, as in
(P-Pbar) . (Q-Qbar)
Is it the dot product?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!