Loma Prieta Earthquake Analysis
This example shows how to analyze and visualize earthquake data.
Load Earthquake Data
The file quake.mat contains 200Hz data from the October 17, 1989 Loma Prieta earthquake in the
Santa Cruz Mountains. The data are courtesy of Joel Yellin at the Charles F. Richter Seismological
Laboratory, University of California, Santa Cruz.
Start by loading the data.
load quake
whos e n v
Name
Size
Bytes Class
Attributes
e
10001x1
80008 double
n
10001x1
80008 double
v
10001x1
80008 double
In the workspace there are three variables, containing time traces from an accelerometer located in
the Natural Sciences building at UC Santa Cruz. The accelerometer recorded the main shock
amplitude of the earthquake wave. The variables n, e, v refer to the three directional components
measured by the instrument, which was aligned parallel to the fault, with its N direction pointing in
the direction of Sacramento. The data are uncorrected for the response of the instrument.
Create a variable, Time, containing the timestamps sampled at 200Hz with the same length as the
other vectors. Represent the correct units with the seconds function and multiplication to achieve
the Hz (s −1 ) sampling rate. This results in a duration variable which is useful for representing
elapsed time.
Time = (1/200)*seconds(1:length(e))';
whos Time
Name
Size
Bytes Class
Attributes
Time
10001x1
80010 duration
Organize Data in Timetable
Separate variables can be organized in a table or timetable for more convenience. A timetable
provides flexibility and functionality for working with time-stamped data. Create a timetable with
the time and three acceleration variables and supply more meaningful variable names. Display the
first eight rows using the head function.
varNames = {'EastWest', 'NorthSouth', 'Vertical'};
quakeData = timetable(Time, e, n, v, 'VariableNames', varNames);
head(quakeData)
ans=8×3 timetable
Time
EastWest
NorthSouth
Vertical
_________
________
__________
________
0.005 sec
5
3
0
0.01 sec
5
3
0
0.015 sec
5
2
0
Loma Prieta Earthquake Analysis
10-41
This example shows how to analyze and visualize earthquake data.
Load Earthquake Data
The file quake.mat contains 200Hz data from the October 17, 1989 Loma Prieta earthquake in the
Santa Cruz Mountains. The data are courtesy of Joel Yellin at the Charles F. Richter Seismological
Laboratory, University of California, Santa Cruz.
Start by loading the data.
load quake
whos e n v
Name
Size
Bytes Class
Attributes
e
10001x1
80008 double
n
10001x1
80008 double
v
10001x1
80008 double
In the workspace there are three variables, containing time traces from an accelerometer located in
the Natural Sciences building at UC Santa Cruz. The accelerometer recorded the main shock
amplitude of the earthquake wave. The variables n, e, v refer to the three directional components
measured by the instrument, which was aligned parallel to the fault, with its N direction pointing in
the direction of Sacramento. The data are uncorrected for the response of the instrument.
Create a variable, Time, containing the timestamps sampled at 200Hz with the same length as the
other vectors. Represent the correct units with the seconds function and multiplication to achieve
the Hz (s −1 ) sampling rate. This results in a duration variable which is useful for representing
elapsed time.
Time = (1/200)*seconds(1:length(e))';
whos Time
Name
Size
Bytes Class
Attributes
Time
10001x1
80010 duration
Organize Data in Timetable
Separate variables can be organized in a table or timetable for more convenience. A timetable
provides flexibility and functionality for working with time-stamped data. Create a timetable with
the time and three acceleration variables and supply more meaningful variable names. Display the
first eight rows using the head function.
varNames = {'EastWest', 'NorthSouth', 'Vertical'};
quakeData = timetable(Time, e, n, v, 'VariableNames', varNames);
head(quakeData)
ans=8×3 timetable
Time
EastWest
NorthSouth
Vertical
_________
________
__________
________
0.005 sec
5
3
0
0.01 sec
5
3
0
0.015 sec
5
2
0
Loma Prieta Earthquake Analysis
10-41
