MATLAB: Frequency histogram for selected values in a vector

histogramrelative frequencyspeedwind

I have 3 vectors time, wind speed and wind direction. I want to plot a histogram showing the relative frequency (or the absolute frequency) of occurrence of wind speeds below 4 knots for every 30 degree arc. In that way i will be able to see which 30 degree arc has the highest frequency of wind speeds below 4 knots.

Best Answer

You can use logical indexing to filter your data:
LowWindData=data(WindSpeed<4);
histogram(LowWindData)
See doc histogram what other options you have to achieve a result that best suits your needs.
Related Question