MATLAB: Determing frequency and probability

frequencyMATLABprobabilityprogramming

I want to implemant in matlab the frequency and the probability of wind speed.
v = [0 2 2 0 4 3 3 2 5 7 0 0 4 1 10 9 6 13 3 0];
n = length(v);
frq = (x/n)*100; % frq = frequency to have i wind speed
F % F = probability to have v >= 0

Best Answer

Simply call histogram().
But I really don't understand why you divide by the length of the vector to get the frequency - that makes no sense at all. I'd think you should divide by either the max count, or by the sum of all counts, depending on your definition of normalizing.