Lecture31 - Engineering 101 Engineering 101 Lecture 31...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Engineering 101 Engineering 101 Lecture 31 Lecture 31 Creating and Manipulating Matrices in Creating and Manipulating Matrices in MATLAB MATLAB Prof. Michael Falk University of Michigan, College of Engineering Announcements Announcements Project 7 – Due Weds Nov 22 at 5pm Turned in on paper in Pierpont B519 May be turned in early to your GSI or to their mailbox in Pierpont B519 (note that this room is not open all hours). Announcements Announcements Exam 3 Tonight, 7-9pm Exam Rooms by Last Name: – A-B Dow 1018 – C-G Chrysler 133 – H-K Dow 1017 – L-O Dow 1014 – P-Z Chrysler 220 (Cheseborough) Announcements Announcements You may bring your book, notes, or any other materials you desire. You may bring a calculator. If you have questions about the exam ask the proctor (me or a GSI). You may not communicate with each other or anyone other than the proctor during the exam. Creating Matrices Creating Matrices Matrices are automatically assumed to be in row order separated by commas or spaces. Rows can be separated by semicolons (;) or new lines. a = [1.0, 3.0, 5.0; 2.0, 4.0, 6.0] b = [1.0 3.0 5.0 2.0 4.0 6.0 ] Creating Matrices Creating Matrices The number of elements in every row must be the same and the number of elements in every column must be the same. b = [ 10 15 20; 6 9 ] error! Creating Matrices Creating Matrices An element of a matrix may be referenced using parentheses. Note that, unlike C++, rows and columns in MATLAB are numbered starting at 1. If c has not been previously created c(2, 3) = 5; Is equivalent to the statement c = [ 0 0 0 0 5 ]; Creating Matrices Creating Matrices You may also use algebraic operations or references to data in the definition of an array a = [ 0 1+1 1+3*4 ]; b = [ a(2) a(1) a ]; Is equivalent to a = [ 0 2 13 ]; b = [ 2 0 0 2 13 ]; Shortcut Expressions for Matrix Shortcut Expressions for Matrix Initialization Initialization If you want to create a vector in which the terms are regularly spaced you can use the colon operator....
View Full Document

This note was uploaded on 04/02/2008 for the course ENGR 101 taught by Professor Ringenberg during the Fall '07 term at University of Michigan.

Page1 / 43

Lecture31 - Engineering 101 Engineering 101 Lecture 31...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online