CS 100 M Lecture 18

# CS 100 M Lecture 18 - 18 More on 2D Arrays And their...

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

18. More on 2D Arrays And their connections to Cell arrays Structure arrays Character arrays

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

View Full Document
Application: Digital Displays
7-by-5 “Dot Matrices”

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

View Full Document
A “Bit Map” For Each Digit A “light” is either on or off. A 7-by-5 matrix of zeros and ones can “tell the whole story”.
Look at Computations with These Bitmaps First order of business: Store the 10 bitmaps

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

View Full Document
Design Decisions How do we package a particular digit? numerical array or character array How do we package the collection of digits? cell array or structure array We look at the 4 possibilities.
Storing a Single Bitmap

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

View Full Document
[ 0 1 1 1 0;… 1 0 0 0 1;… 0 0 0 1 0;… 0 0 1 0 0;… 0 1 0 0 0;… 1 0 0 0 0;… 1 1 1 1 1]; Can Use a Numerical Array For Each Digit
A = [ ‘01110’;… ‘10001’;… ‘00010’;… ‘00100’;… ‘01000’;… ‘10000’;… ‘11111’]; Can Use a Character Array For Each Digit

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

View Full Document
Storing the 10 Bitmaps in a Cell Array
M = [ 0 1 1 1 0;… 1 0 0 0 1;… 0 0 0 1 0;… 0 0 1 0 0;… 0 1 0 0 0;… 1 0 0 0 0;… 1 1 1 1 1]; D{2} = M; Can Use a Cell Array this way Here a cell is a numerical matrix

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/23/2008 for the course CS 100 taught by Professor Fan/vanloan during the Spring '07 term at Cornell.

### Page1 / 31

CS 100 M Lecture 18 - 18 More on 2D Arrays And their...

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

View Full Document
Ask a homework question - tutors are online