Home > timeplt5 > demo.m

demo

PURPOSE ^

DEMO demonstrates the use of TIMEPLT and STACKLBL.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 DEMO demonstrates the use of TIMEPLT and STACKLBL.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % DEMO demonstrates the use of TIMEPLT and STACKLBL.
0002 %
0003 
0004 % Call TIMEPLT specifying east and north velocity components
0005 % in the bottom panel, vector magnitude in the middle panel and a vector
0006 % stick plot in the top panel.  Note: each stick plot must have it's own panel
0007 
0008 
0009 %
0010 % Demonstrate for each time catagory.
0011 
0012 % years
0013   start=[1970 11 1 0 0 0];    %Gregorian start [yyyy mm dd hh mi sc]
0014   stop=[1996 2 1 0 0 0];
0015   jd=julian(start):100:julian(stop);
0016 
0017 % synthesize velocity data
0018   u=sin(.1*jd(:)/100).^2-.5;
0019   v=cos(.1*jd(:)/100);
0020 
0021 % convention: store velocity time series as complex vector:
0022   w=u+i*v;
0023 
0024   h=timeplt(jd,[u v abs(w) w],[1 1 2 3]);
0025   title('Demo of TIMEPLT and STACKLBL:  Years')
0026  
0027 % use STACKLBL to label each stack plot panel with title and units:
0028 
0029   stacklbl(h(1),'East + North velocity','m/s');
0030   stacklbl(h(2),'Speed','m/s');
0031   stacklbl(h(3),'Velocity Sticks','m/s');
0032 
0033 
0034 disp('hit enter to continue')
0035 pause
0036 
0037 % months
0038 
0039   start=[1990 1 1 0 0 0];    %Gregorian start [yyyy mm dd hh mi sc]
0040   stop=[1991 4 1 0 0 0];
0041   jd=julian(start):10:julian(stop);
0042 
0043 % synthesize velocity data
0044   u=sin(.1*jd(:)/10).^2-.5;
0045   v=cos(.1*jd(:)/10);
0046 
0047 % convention: store velocity time series as complex vector:
0048   w=u+i*v;
0049 
0050   h=timeplt(jd,[u v abs(w) w],[1 1 2 3]);
0051   title('Demo of TIMEPLT and STACKLBL:  Months')
0052  
0053 % use STACKLBL to label each stack plot panel with title and units:
0054 
0055   stacklbl(h(1),'East + North velocity','m/s');
0056   stacklbl(h(2),'Speed','m/s');
0057   stacklbl(h(3),'Velocity Sticks','m/s');
0058 
0059 
0060 disp('hit enter to continue')
0061 pause
0062 
0063 % days
0064   start=[1990 1 1 0 0 0];    %Gregorian start [yyyy mm dd hh mi sc]
0065   stop=[1990 1 15 0 0 0];
0066   jd=[julian(start):1/6:julian(stop)];
0067 
0068 % synthesize velocity data
0069   u=sin(.1*jd(:)*10).^2-.5;
0070   v=cos(.1*jd(:)*10);
0071 
0072 % convention: store velocity time series as complex vector:
0073   w=u+i*v;
0074 
0075   h=timeplt(jd,[u v abs(w) w],[1 1 2 3]);
0076   title('Demo of TIMEPLT and STACKLBL:  Days')
0077  
0078 % use STACKLBL to label each stack plot panel with title and units:
0079 
0080   stacklbl(h(1),'East + North velocity','m/s');
0081   stacklbl(h(2),'Speed','m/s');
0082   stacklbl(h(3),'Velocity Sticks','m/s');
0083 
0084 
0085 
0086 disp('hit enter to continue')
0087 pause
0088 
0089 % hours
0090   start=[1990 1 1 0 0 0];    %Gregorian start [yyyy mm dd hh mi sc]
0091   stop=[1990 1 1 15 0 0];
0092   jd=[julian(start):1/100:julian(stop)];
0093 
0094 % synthesize velocity data
0095   u=sin(.1*jd(:)*100).^2-.5;
0096   v=cos(.1*jd(:)*100);
0097 
0098 % convention: store velocity time series as complex vector:
0099   w=u+i*v;
0100 
0101   h=timeplt(jd,[u v abs(w) w],[1 1 2 3]);
0102   title('Demo of TIMEPLT and STACKLBL:  Hours')
0103  
0104 % use STACKLBL to label each stack plot panel with title and units:
0105 
0106   stacklbl(h(1),'East + North velocity','m/s');
0107   stacklbl(h(2),'Speed','m/s');
0108   stacklbl(h(3),'Velocity Sticks','m/s');
0109 
0110 
0111 
0112 
0113 disp('hit enter to continue')
0114 pause
0115 
0116 % minutes
0117   start=[1990 12 31 23 38 0];    %Gregorian start [yyyy mm dd hh mi sc]
0118   stop=[1991 1 1 0 20 0];
0119   jd=[julian(start):1/5000:julian(stop)];
0120 
0121 % synthesize velocity data
0122   u=sin(.1*jd(:)*500).^2-.5;
0123   v=cos(.1*jd(:)*500);
0124 
0125 % convention: store velocity time series as complex vector:
0126   w=u+i*v;
0127 
0128   h=timeplt(jd,[u v abs(w) w],[1 1 2 3]);
0129   title('Demo of TIMEPLT and STACKLBL:  Minutes')
0130  
0131 % use STACKLBL to label each stack plot panel with title and units:
0132 
0133   stacklbl(h(1),'East + North velocity','m/s');
0134   stacklbl(h(2),'Speed','m/s');
0135   stacklbl(h(3),'Velocity Sticks','m/s');

Generated on Wed 30-Nov-2005 15:41:45 by m2html © 2003