Lab 1: Getting started with MATLAB
The objectives of this lab are to introduce:
1. Overview of the MATLAB environment
2. Overview of file types and data types
3. Getting help and documentation
4. Matrices and arrays
5. Simple plotting functions: line plot, bar graph, histogram, box plot, empirical (exper-
imental CDF)
6. Saving and publishing your work
Tutorials
Getting Started with MATLAB at:
[Link]
File Management
Create a folder on your personal hard drive u:\courses\cive203\labs\lab1. Save this lab
description and the MATLAB m-file in this folder. Change the title of the m-file appropriate-
ly. Double click the m-file to open the document. Follow instructions provided during the
lab period to complete the lab. Submit the final PDF document on CANVAS at the end of the
lab period.
California Earthquake Data
The occurrence of the annual largest magnitude earthquakes for 20 years observed be-
tween 1990 and 2014 in California is summarized in Table 1.
Analysis
Using the m-file provided with the lab materials, enter the earthquake magnitude data in
the appropriate section and perform the following procedures:
(a) Compute mean, median, mode, minimum, maximum, standard deviation, variance,
and inter-quartile range of the earthquake magnitudes.
(b) Plot the earthquake magnitude data versus year.
(c) Construct a bar graph of the magnitude data.
(d) Construct a histogram of the magnitude data with 5 bins.
1
(e) Construct a box-whiskers plot of the magnitude data.
(f) Construct the empirical (experimental) CDF (i.e., plotting position) of the data.
(g) Publish your work, print the report as a PDF file, and upload the PDF file on Canvas.
Table 1. Annual maximum earthquake magnitudes in California (1990-2014),
Source: NOAA, national Geophysical Data Center, Significant Earthquake Database.
Year Name Magnitude
1990 CLAREMONT, COVINA 5.5
1991 HONEYDEW, WHITETHORN, PETROLIA 6.2
1992 LANDERS, YUCCA VALLEY 7.6
1993
1994 NORTHRIDGE 7.0
1995
1996
1997
1998
1999 LUDLOW, LANDERS, TWENTYNINE PALMS 7.2
2000 NAPA 5.0
2001 LOS ANGELES 4.2
2002
2003 PASO ROBLES,TEMPLETON,ATASCADERO 6.6
2004 CENTRAL: PARKFIELD, SAN MIGUEL 6.0
2005 OFF COAST NORTHERN 7.2
2006
2007 SAN JOSE 5.6
2008 LOS ANGELES 5.4
2009
2010 OFF COAST NORTHERN 6.5
2011
2012
2013
2014 NAPA, VALLEJO 6.0