How to create plot of wind direction vs time

10 vues (au cours des 30 derniers jours)
Munir Baldomero
Munir Baldomero le 12 Mai 2023
Good day!
I would like to ask for help. I want to create a meteogram using matlab and I would like to know if there is someone who did a plot of wind direction vs time . I attached a sample image of what I want to do with the data.

Réponses (1)

Anish Gupta
Anish Gupta le 21 Mai 2023
Hello Munir,
As per my understanding, you want to create a plot which depicts wind direction at different time. This can be done using the "quiver" plot. For your reference, the below code demonstrates the suggested method for using “quiver” plot:
close all
figure('Position',[0 0 1000 200])
time=[0:24];%This contains your time values
a=0.75;
theta=2*pi*rand(1,25);% this contains your list of wind directions
for i=1:length(time)
quiver(time(i),0,a*cos(theta(i)),a*sin(theta(i)),'r','LineWidth',2,'MaxHeadSize',1.0)
hold on
end
xlim([min(time)-2,max(time)+2])
ylim([-2,2])
yticklabels([])
xticks(time)
For more information on “quiver” plot, please refer the following documentation link:

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by