MATLAB: How to plot Histograms for multiple data

histogramStatistics and Machine Learning Toolbox

I have about 20 .mat data and I need a code to load all the data from a folder and calculate their histograms. cheers.

Best Answer

Inside each loop call hist() and plot(). You might want to use a different color for each plot to distinguish them from each other.
[counts, binCenters] = hist(yourData, numberOfBins);
hold on;
plot(binCenters, counts, 'Color', rand(1,3));