NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/FCAST_1.2/matlab_cen/plot_vec.m

Revision 495 (checked in by cbc, 11 years ago)

Initial import of Stark code.

Line 
1 newplot='y';
2 while newplot == 'y',
3 %
4 % Load data from files
5 %
6    !ls *.vec
7    filename=input('Enter the name of .vec file: ','s');
8    load(filename)
9    vec=eval(blank(filename(7:length(filename)-4)));
10    ue=vec(:,2);
11    ve=vec(:,3);
12    gridname='yessub';
13    [in,x,y,z,bnd]=loadgrid(gridname);
14    size(in);
15    ne=ans(1);
16    for j=1:ne
17       xe(1,j)=(x(in(j,1))+x(in(j,2))+x(in(j,3)))/3.0;
18       ye(1,j)=(y(in(j,1))+y(in(j,2))+y(in(j,3)))/3.0;
19    end
20 %
21 % Plot boundary
22 %
23    figure
24    whitebg('w')
25    hold on
26    bndo=plotbnd(x,y,bnd);
27    set(bndo,'Color','k')
28    axis('equal')
29 %
30 % Plot vector field
31 %
32    newscale='y';
33    while newscale == 'y',
34       title([filename])
35       vmax=max(abs(ue+sqrt(-1.0)*ve))
36       scale=input('Enter the desired vector scale: ');
37       hv=vecplot2(xe,ye,ue,ve,scale,'m/s',max(x)-0.1*(max(x)-min(x)),min(y)+0.1*(max(y)-min(y)))
38       set(hv,'Color','k')
39       zoom on
40       newscale=input('New scale? (y/n): ','s');
41       if newscale == 'y',
42          delete(hv);
43       end
44    end
45    newplot=input('New plot? (y/n): ','s');
46 end
Note: See TracBrowser for help on using the browser.