%Matlab script to plot velocity profile and velocity gradient profile for 
%southern California based on SCEC velocity model

%profile is along a NE-SW line just northwest of the Salton Sea

%data:
%distance from the southwest in km:
dist =  [6.12 61.22 82.65 102.56 123.98 134.7 140.816 156.122 229.6];
mmdist = dist.*10^6;
v = [35.5 34.2 32.9 28.9 18.4 17.1 13.16 6.6 0];

close all

subplot(2,1,1)
plot(dist,v,'k.', dist,v,'k-');
title('NE-SW velocity profile (SAF parallel component) for Southern California')
xlabel('Distance (km)')
ylabel('Velocity relative to North America (mm/yr)')
axis([0 250 0 40])

subplot(2,1,2)
vgrad = diff(v)./diff(mmdist);
vgraddist = dist(1:length(dist)-1)+diff(dist)./2;

plot(vgraddist,vgrad,'r+', vgraddist,vgrad,'r-');
title('NE-SW velocity gradientprofile (SAF parallel component) for Southern California')
xlabel('Distance (km)')
ylabel('Velocity gradient (yr^-1)')
axis([0 250  -10^-6 0])

print v.eps  -depsc 

