MATLAB风玫瑰图WindRose绘制记录(已知风的u、v分量如何计算风向。)

MATLAB风玫瑰图WindRose绘制记录

官方.m文件下载地址
用于创建方向强度直方图,也称为“风玫瑰图”。
内置函数:WindRose()

   [figure_handle,count,speeds,directions,Table] = WindRose(direction,speed);
   [figure_handle,count,speeds,directions,Table] = WindRose(direction,speed,'parameter1',value1,...);
 % Example1:
      %----------------------------------------------------------------
      d = 360 * rand(10000,1); % My reference is North = 0°, East = 90°.
      v = 30*rand(10000,1);
      
      % Default notation with several input arguments
      [figure_handle,count,speeds,directions,Table] = WindRose(d,v,'anglenorth',0,'angleeast',90,'labels',{'N (0°)','S (180°)','E (90°)','W (270°)'},'freqlabelangle',45);
% Example2:
  % All the wind rose options into a cell array, so function call can be simplified
  Properties = {'anglenorth',0,'angleeast',90,'labels',{'N (0°)','S (180°)','E (90°)','W (270°)'},'freqlabelangle',45};
  [figure_handle2,count2,speeds2,directions2,Table2] = WindRose(d,v,Properties);
% Example3:
      % All the wind rose options into a structure, so function call can be simplified.
      Options.AngleNorth     = 0;
      Options.AngleEast      = 90;
      Options.Labels         = {'N (0°)','S (180°)','E (90°)','W (270°)'};
      Options.FreqLabelAngle = 45;
      [figure_handle3,count3,speeds3,directions3,Table3] = WindRose(d,v,Options);

绘图注意点:
1、风玫瑰图上所表示的风向即风的来向,是指从外面吹向地区中心的方向。
2、默认风向0°为正北方向,90°为正东方向。
3、如果想修改图表中legend的标题可以在下载的WindRose.m文件中找到对应代码修改。

附:已知风的u、v分量如何计算风向。
参考博客

wdir=mod(270-atan2(v,u)/pi*180,360);

atan2返回的是[-pi,pi]范围内的数值,要转换为角度值。

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值