
The below code is written to generate 100 random numbers and histogram() is used to plot a histogram for the generated data. A histogram can be created by using the inbuilt function histogram(). Where X: Data input in the form of vector or matrix.Ī 1,a 2,….,a n: Attribute values (optional)Ĭreation of Histogram in Matlab: MATLAB makes it a single click action to create a histogram for any data. The syntax for the above-recommended functions are as follows: histogram(), histcounts() and discretize().

In later versions those functions are replaced with new functions with advanced capabilities i.e.

In earlier versions, hist() and histc() were used to generate histogram plots. Hadoop, Data Science, Statistics & others
