Seismograph Plotting Program

Seismograph Plotting program

Updated 08/12/04

The following program was written to plot the data from the MVHS Earthquake Simulation Project. This program reads two files and generates plots. The data used was 200 Hz, thus the time interval is set to 0.005. The plot could then be printed out and used to determine the distance to the quake and the magnitude.
% This file will read two data files and plot the seismograms

clear

% Read the files
radial= input('Enter radial filename without .dat, with single quotes ');
load([radial '.dat']);
rad = eval(radial);

% load('rad.dat');

horizont = input('Enter horizontal filename without .dat, with single quotes ');
load([horizont '.dat']);
ver = eval(horizont);

% load('ver.dat');
vn=size(ver,1);
rn=size(rad,1);
vn=(vn*0.005-0.005);
rn=(rn*0.005-0.005);

% Set up time files
% Vertical time is 0.005 sec between
vertime=0:0.005:vn;

% Radial time is 0.005 sec between
radtime=0:0.005:rn;


% Plot seisomograms

subplot(211), plot (vertime, ver);
title ('Horizontal Wave');
xlabel ('Time');
ylabel ('Amplitude');


subplot(212), plot (radtime, rad);
title ('Radial Wave');
xlabel ('Time');
ylabel ('Amplitude');