Wind rose with no degrees for direction
    2 ビュー (過去 30 日間)
  
       古いコメントを表示
    
I am trying to plot a wind rose but for direction I only have N, NE, NNE etc rather than degrees. Is there a code or script for this?
3 件のコメント
  Torsten
      
      
 2025 年 2 月 26 日
				
      編集済み: Torsten
      
      
 2025 年 2 月 26 日
  
			Usually you start with E = (1,0) as 0°, goto N = (0,1) as 90°, goto W = (-1,0) as 180°, goto S = (0,-1) as 270°.
The coordinates can then be obtained by the cosd and sind functions:
[cosd(0),sind(0)] 
[cosd(90),sind(90)]
[cosd(180),sind(180)] 
[cosd(270),sind(270)] 
But you are right: I just found that the relation between angle and direction seems to be different for wind roses:
回答 (1 件)
  Steven Lord
    
      
 2025 年 2 月 26 日
        Let's make some random direction data.
directions = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"];
n = numel(directions);
angles = 0:45:315;
randomDirections = directions(randi(n, 1, 10));
Now we can convert those strings into the corresponding angles.
[~, indices] = ismember(randomDirections, directions);
correspondingAngles = angles(indices);
And now we can show the results as a table so you can check.
results = table(randomDirections.', correspondingAngles.', VariableNames = ["dir", "angle"])
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Structures についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!