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

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

View Full Document Right Arrow Icon
18. More on 2D Arrays And their connections to Cell arrays Structure arrays Character arrays
Background image of page 1

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

View Full DocumentRight Arrow Icon
Application: Digital Displays
Background image of page 2
7-by-5 “Dot Matrices”
Background image of page 3

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

View Full DocumentRight Arrow Icon
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”.
Background image of page 4
Look at Computations with These Bitmaps First order of business: Store the 10 bitmaps
Background image of page 5

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

View Full DocumentRight Arrow Icon
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.
Background image of page 6
Storing a Single Bitmap
Background image of page 7

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

View Full DocumentRight Arrow Icon
[ 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
Background image of page 8
A = [ ‘01110’;… ‘10001’;… ‘00010’;… ‘00100’;… ‘01000’;… ‘10000’;… ‘11111’]; Can Use a Character Array For Each Digit
Background image of page 9

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

View Full DocumentRight Arrow Icon
Storing the 10 Bitmaps in a Cell Array
Background image of page 10
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
Background image of page 11

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

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

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 Right Arrow Icon
Ask a homework question - tutors are online