separated constant part in module_w_assembly.f90
[wrf-fire-matlab.git] / femwind / plot_wind_3d.m
blobf88aa3e96f65793ac0d5d8c7b723aaa1b50b6459
1 function plot_wind_3d(CX,W,level,scale,stride)
2 % plot_wind_3d(CX,W,level,scale)
3 % in:
4 %     CX     {x,y,z} 3D coordinates where the wind vectors are located
5 %     W      {u,v,w} 3D wind vectors
6 %     level  vector of number of vertical levels to display
7 %            default if none or empty: all levels
8 %     scale  scaling of wind vector arrow, see doc quiver
9 %     stride display wind vectors
11 all_levels = false;
12 [n(1),n(2),n(3)]=size(CX{1});
13 if ~exist('level','var') || isempty(level)
14     level=1:n(3);
15 end
16 if ~exist('scale','var') || isempty(scale)
17     scale = 0.9;
18 end
20 if ~exist('stride','var') || isempty(stride)
21     stride = 1;
22 end
24 quiver3(CX{1}(1:stride:end,1:stride:end,level),...
25     CX{2}(1:stride:end,1:stride:end,level),...
26     CX{3}(1:stride:end,1:stride:end,level),...
27     W{1}(1:stride:end,1:stride:end,level),...
28     W{2}(1:stride:end,1:stride:end,level),...
29     W{3}(1:stride:end,1:stride:end,level),...
30     scale,'LineWidth',2)
31 xlabel('x'), ylabel('y'), zlabel('z')
32 end