% Matlab script for Example 1: AVO data
% Author: Matt Gardine, April 2009

% Step 1
dbname = '/Seis/Kiska4/picks/Total/Total';
db = dbopen(dbname,'r');

% Step 2
db = dblookup(db,'','origin','','');

% Step 3 & 4
db = dbsubset(db,'lat>60.3 && lat<60.7 && lon>-153 && lon<-152.3');
db = dbsubset(db,'time > "May 1 1999"');

% Step 5
[time] = dbgetv(db,'time');

% Convert time from epoch time to Matlab serial time
time = datenum(strtime(time));

% Close the database
dbclose(db);

% Plot the data
figure
plot(time,(1:length(time)))

% Convert the dates on the X axis to readable times
datetick('x','mm/yyyy','keepticks','keeplimits')

% You can add on from here to make the figure "pretty" - change
% the limits, add axis labels and a title, etc.