2D wave direction Plot with Arrow
조회 수: 7 (최근 30일)
이전 댓글 표시
Muhammad Uswah Pawara
2021년 11월 6일
편집: Sudharsana Iyengar
2021년 11월 8일
Dear All
I am trying to make a plot of 2D wave direction but I am not sure the script whether is it true or not,
Please give me some reference to plot the wave direction
Attached the script, data, and, result
댓글 수: 0
채택된 답변
Sudharsana Iyengar
2021년 11월 6일
편집: Sudharsana Iyengar
2021년 11월 8일
You can use the in built quiver function which is in Matlab. For instance when you want to plot the wind direction in a given region, you can use quiver function.
What quiver does is, it takes 4 arguments. X,Y is the postions and then U and V which are the x and y component of what ever physical parameter you want to study about. For more details. https://in.mathworks.com/help/matlab/ref/quiver.html
The M map tool box by the https://www.eoas.ubc.ca/~rich/map.html contains there own scripts which will add the maps to the plot.
I hope this helps. I dont have M map tool box. I just used Matlab's quiver function to get this figure attached below.
load('D.mat')
[lat,lon]=meshgrid(-60:2:0,20:2:134);
u=sind(D/6);
v=cosd((D)/6);
%m_proj('oblique','lat',[12 -60],'lon',[60 160],'aspect',.8);
%m_coast('patch',[.9 .9 .9],'edgecolor','none');
%m_grid('tickdir','out','yaxislocation','right',...
%'xaxislocation','top','xlabeldir','end','ticklen',.02);
hold on;
quiver(lon,lat,u,v); % note I have used quiver function.
xlabel('wave direction');
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!