Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to obtain histogram data in Matlab

Tags:

matlab

As we know, 'hist' function in Matlab plots the histogram of an array. I need to know the numerical value of each bin. Could you help me please?

thanks

like image 806
Shadi Avatar asked Jun 22 '10 19:06

Shadi


People also ask

How do you extract data from a histogram?

When we create a histogram and save it in an object name then we can extract the frequencies as count for the mid values or breaks by calling that object. We can consider that mid values or breaks obtained by the object are the actual value against which the frequencies are plotted on the histogram.

How does Matlab calculate histograms?

[ counts , binLocations ] = imhist( I , n ) specifies the number of bins, n , used to calculate the histogram. [ counts , binLocations ] = imhist( X , cmap ) calculates the histogram for the indexed image X with colormap cmap . The histogram has one bin for each entry in the colormap.

What is histogram command in Matlab?

Description. Histograms are a type of bar plot for numeric data that group the data into bins. After you create a Histogram object, you can modify aspects of the histogram by changing its property values. This is particularly useful for quickly modifying the properties of the bins or changing the display.

How do you plot a 2d histogram in Matlab?

Specify Centers of Histogram BinsCreate a bivariate histogram on the bins specified by the bin centers, and count the number of elements in each bin. Load the sample data. Create a bivariate histogram. Specify the centers of the histogram bins using a two-element cell array.


1 Answers

Specify an output for hist.

[h,bins]=hist(data)

will get you what you want.

like image 118
Doresoom Avatar answered Sep 20 '22 05:09

Doresoom