CS 100 M Lecture 14

CS 100 M Lecture 14 - 14. Cell Arrays Set-Up Subscripting...

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

View Full Document Right Arrow Icon
14. Cell Arrays Set-Up Subscripting Nested Loops String Manipulations
Background image of page 1

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

View Full DocumentRight Arrow Icon
A Small Cell Array… C = { ‘Alabama’,’New York’,’Utah’}; C: ‘Alabama’ ‘New York’ ‘Utah’
Background image of page 2
Syntax C = { ‘Alabama’,’New York’,’Utah’}; Curly Brackets Entries Separated by Commas
Background image of page 3

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

View Full DocumentRight Arrow Icon
Synonym C = { ‘Alabama’,’New York’,’Utah’}; C = cell(1,3); C{1} = ‘Alabama’; C{2} = ‘New York’; C{3} = ‘Utah’; Application: Storing strings
Background image of page 4
“Vertical” Cell Array Set-up C = { ‘Alabama’;’New York’;’Utah’}; C = cell(3,1); C{1} = ‘Alabama’; C{2} = ‘New York’; C{3} = ‘Utah’; Application: Storing strings
Background image of page 5

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

View Full DocumentRight Arrow Icon
Another Small Cell Array… C = { [1 2 3],[10;20], zeros(1,4)}; C: [1 2 3] [10;20] zeros(1,4)
Background image of page 6
Syntax C = { [1 2 3], [10;20], zeros(1,4)}; Curly Brackets Entries Separated by Commas
Background image of page 7

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

View Full DocumentRight Arrow Icon
Synonym C = cell(1,3); C{1} = [1 2 3]; C{2} = [10;20]; C{3} = zeros(1,4); Application: Storing a Set of Arrays C = { [1 2 3], [10;20], zeros(1,4)};
Background image of page 8
Problem: Set Up a Card Deck
Background image of page 9

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

View Full DocumentRight Arrow Icon
Idea… A{1} = ‘A Hearts’; A{2} = ‘2 Hearts’; : A{13} = ‘K Hearts’; A{14} = ‘A Clubs’; : A{52} = ‘K Diamonds’;
Background image of page 10
Initializations… suit = {‘Hearts’, ‘Clubs’, … ‘Spades’, ‘Diamonds’}; rank = {‘A’,‘2’,’3’,’4’,’5’,’6’,… ’7’,’8’,’9’,’10’,’J’,’Q’,’K’}; A = cell(1,52);
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.

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 / 45

CS 100 M Lecture 14 - 14. Cell Arrays Set-Up Subscripting...

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