{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

P.Lecture - 2.19.08

# P.Lecture - 2.19.08 - Announcements Assignment 3 Exam 1...

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

Announcements • Assignment 3 • Exam 1 – Graded – Back in recitations on Friday – Statistics on Thursday (hopefully) • Read Chapters 11,12, 13 and 22 • Topics for today – Matrices – Random numbers – Strings (time permitting)

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

View Full Document
Review: 2D Arrays • Used for tables and matrices • Declaration similar to one dimensional arrays • Need to specify both the number of rows and columns during allocation • For example: int myMatrix [10] [10]; double energyTable [5] [6]; char conversionTable [26] [26];
Matrix operations • C does not have a primitive matrix data type It’s treated as a 2 D array – It s treated as a 2 D array Common matrix operations must be programmed! • Matrix transpose, inversion, addition, multiplication, etc. – C is not MATLAB – More on matrix operations later 3

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

View Full Document
What is a Matrix? • A matrix is a set of elements, organized into rows and columns A is a 2 X 2 matrix 2 columns 01 00 a a 11 10 a a 2 rows