CS Sept10'08 - CS 1371 TEST WEDNESDAY! -Vectors -...

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

View Full Document Right Arrow Icon
CS 1371 TEST WEDNESDAY!!!!! -Vectors - Condition(if, else) -iteration(for/while loops) -functions* -strings* -cell arrays* **GO THROUGH OLD EXAMS** 9/10/2008 Structures Create 1. Direct Entry 2. Struct(. .) 3. Custom function Matlab - rmfield - getfield - setfield Direct Entry Creating a Structure with Direct Entry: jane (name of structure) .name (field name) = ‘jane’ (Stores the name jane) jane.grades = [97 99 98] To Call: tests = jane.grades -> 97 99 98 test1 = jane.grades(1) -> 97 Substructures: birth.month = ‘Nov’; birth.day = 12; birth.year = 1988; jane.birth = birth;
Background image of page 1

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

View Full DocumentRight Arrow Icon
To Call A Variable in ‘birth’: Month: bmonth = jane.birth.month -> ‘Nov’ To Change A Variable in ‘birth’: jane.birth.month = ‘Sep’ (Changes the month to ‘Sep’) To Create A New Variable in ‘jane’: jane.birth.dayofweek = ‘Weds’ (matlab makes a new vector and stores ‘Weds’ into it) ##Removing a Field in ‘jane’(rmfield): jane = rmfield(jane, ‘grade’); (searches structure for ‘grade’ vector and removes it)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/11/2008 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.

Page1 / 3

CS Sept10'08 - CS 1371 TEST WEDNESDAY! -Vectors -...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online