{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
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)
Background image of page 1

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

View Full Document Right Arrow Icon
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];
Background image of page 2
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
Background image of page 3

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

View Full Document Right Arrow Icon
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
Background image of page 4