フィルターのクリア

how to use rose diagram appear wind direction and wind speed

8 ビュー (過去 30 日間)
peter huang
peter huang 2022 年 5 月 11 日
編集済み: Ayush 2023 年 10 月 31 日
i have wind data (direction and speed) but i can not know matlab polarhistogram code mean
How can I render a rose diagram with wind speed and direction?

回答 (1 件)

Ayush
Ayush 2023 年 10 月 31 日
編集済み: Ayush 2023 年 10 月 31 日
Hi Peter,
I understand that you want to render the rose diagram for wind direction and speed data.
To plot data in polar format, you can utilize the "deg2rad" function to convert wind directions from degrees to radians. This conversion enables you to create a rose diagram to visualize the data. Below is an example code that provides a clearer understanding of the process:
% Sample wind speed and direction data
wind_speed = [5, 10, 15, 20, 25]; % Wind speeds in m/s
wind_direction = [30, 60, 90, 120, 150]; % Wind directions in degrees
figure
pax = polaraxes;
polarhistogram(deg2rad(wind_direction(wind_speed<=25)),deg2rad(0:10:360),'displayname','20 - 25 m/s')
hold on
polarhistogram(deg2rad(wind_direction(wind_speed<20)),deg2rad(0:10:360),'FaceColor','red','displayname','15 - 20 m/s')
polarhistogram(deg2rad(wind_direction(wind_speed<15)),deg2rad(0:10:360),'FaceColor','yellow','displayname','10 - 15 m/s')
polarhistogram(deg2rad(wind_direction(wind_speed<10)),deg2rad(0:10:360),'FaceColor','green','displayname','5 - 10 m/s')
polarhistogram(deg2rad(wind_direction(wind_speed<5)),deg2rad(0:10:360),'FaceColor','blue','displayname','0 - 5 m/s')
pax.ThetaDir = 'clockwise';
pax.ThetaZeroLocation = 'top';
legend('Show')
title('Wind Rose')
For additional information on the "deg2rad" function and related details, please refer to the following link:
  1. https://www.mathworks.com/help/matlab/ref/deg2rad.html
  2. https://www.mathworks.com/matlabcentral/fileexchange/65174-wind_rose-wind_direction-wind_speed
I hope this helps!
Regards,
Ayush

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by