UNIVERSITY OF CALIFORNIA, BERKELEY Engineering 7 – Spring 2009 Department of Civil and Environmental Engineering Instructor: Professor Rector 1Lab 01 Topics: Arrays, Matrices, Linear Algebra, and Basic Plotting Assigned: Friday, 01/30/2009 Due: Friday, 02/06/2009 at 12:00 pm Type: Take Home Remember to use the help command if you are not familiar with a command. It will be much faster than waiting for a GSI to answer your question. Moreover, a list of useful commands is provided at the end of this document. For this lab, you may submit your report as one Word document or one PDF file. Remember to also submit the report on Bpsace! Turn the hard-copy of your lab in the drop boxes at 1109 Etcheverry Hall computer lab.0. Downloading the files related to Lab 01In order to save time, some of the matrices used in this lab are provided to you. They are provided in several files with extension .mat and whose names start with lab1. These files are located in the Lab 01 folder of the Lab Assignments section of the E7 Resources page on Bspace. You can download the files directly by clicking on their names in this PDF document. Download the file lab1matrices.mat now, and save it to your home directory. This file will be used in question 1(b). You will also have to save other files in the rest of this lab. 1. Array Creation (Using Matrix Generation Functions)The purpose of this part is to create arrays using matrix generation functions. You should be able to create each matrix with one single expression; also make note that while the answers are not unique, there are more “efficient” answers. You will receive no credit if you create these arrays manually! Copy the expressions to create each of the following matrices (A through G) and the output into your lab report. (a)Create the following matrices using the matrix generation functions zeros, eye, and ones. Use the help command if you are not familiar with the syntax of these functions. ⎥⎦⎤⎢⎣⎡=000000A, ⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=500050005B, ⎥⎦⎤⎢⎣⎡=3333C(b)Make sure lab1matrices.mat is in your current Matlab directory.If you type load lab1matrices.mat in Matlab, the matrices D, E and F should have been created in your workspace. Warning: if you already have a variable named D, E or F, it will be overwritten.⎥⎦⎤⎢⎣⎡=9632D, ⎥⎦⎤⎢⎣⎡−=9141E, ⎥⎦⎤⎢⎣⎡−=3555F
has intentionally blurred sections.
Sign up to view the full version.