1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| load forcedirection
figure
forcedirection(:,2) = forcedirection(:,2)*pi/180;
[tout,rout] = rose(forcedirection(:,2), 100);
h = polar(tout,rout);
x = get(h, 'XData');
x = reshape(x, 4, []);
y = get(h, 'YData');
y = reshape(y, 4, []);
rout = reshape(rout, 4, []);
delete(h)
hold on
colormap(parula(max(rout(:))))
k = 0;
for n = 1:size(x,2)
if any(x(:,n))
k = k+1;
h(k) = patch('Vertices', [x(:,n) y(:,n)], 'Faces', [1 2 3 4], 'FaceVertexCData', rout(2,n), 'FaceColor', 'flat');
end
end
set(gca, 'CameraPosition', get(gca, 'CameraPosition').*[1 1 -1])
rotate(findall(gca),[0 0 1],-90)
t = findall(0,'Type', 'text');
set(t(1),'string', 'Nord')
set(t(2),'string', 'Sud')
set(t(7),'string', 'Ouest')
set(t(8),'string', 'Est')
delete(t([3:6 9:12])) |
Partager