Frequency histogram for selected values in a vector

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.

2 件のコメント

Rik
Rik 2017 年 10 月 5 日
And your question is?
Have a read here and here. It will greatly improve your chances of getting an answer.
Dimitrios Bentis
Dimitrios Bentis 2017 年 10 月 11 日
I do not know how to plot a histogram with the relative frequencies of wind speeds below 4 knots. How can i do that?

サインインしてコメントする。

 採用された回答

Rik
Rik 2017 年 10 月 11 日

0 投票

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.

3 件のコメント

Dimitrios Bentis
Dimitrios Bentis 2017 年 10 月 13 日
Than you very much for your help.
I was searching for something like this: LowWindData=WindDirection(WindSpeed<4) histogram(LowWindData)
I understand now.
Dimitrios Bentis
Dimitrios Bentis 2017 年 10 月 14 日
I still can't find how to get the relative frequency of that histogram. It plots the absolute frequency. How do i get the same histogram but with relative instead of absolute frequency?
Rik
Rik 2017 年 10 月 14 日
Why don't you read the documentation?
'Normalization' Type of normalization
'count' (default) | 'probability' | 'countdensity' | 'pdf' | 'cumcount' | 'cdf'

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2017 年 10 月 5 日

コメント済み:

Rik
2017 年 10 月 14 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by