Creating a Histogram of Specific Bin Size
Show older comments
Hello all,
I am currently new to Matlab and was tasked with creating a histogram from using several maximum points of a power spectral desnity to discover how frequent a certain signal was and see if there is possibly a sinusoidal or several sinusoidal frequency.
In order to make the data easier to read I would like to create histograms with bin size of .05. How would I go about doing that?
Currently I am useing what my friend told me to use hist(cat(2,fmx,fmx2,fmx3),15) with fmx being the first maxes of my data, fmx2 the 2nd maxes, and so on. I know that the 15 represents the number of bins to use, but I don't understand what the (cat(2 part does nor do I know how to create histograms with a specific bin size
Thank you
Answers (1)
Sean de Wolski
on 13 Apr 2011
cat(2,fmx,fmx2,fmx3)
Run this by itself in the command window and see what it creates! The secret to learning difficult things is to break it into the smallest possible chunks.
I'll spoil it for you: This will create an array [fmx fmx2 fmx3]. cat is short for concatenate and you're going to do it along the (2) second dimension, i.e. columns.
doc cat
Categories
Find more on Histograms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!