L17post - Previous Lecture Working with images Todays Lecture Characters and strings Announcements Section will be in the classrooms this week

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

View Full Document Right Arrow Icon
± Previous Lecture: ± Working with images ± Today’s Lecture: ± Characters and strings ± Announcements: ± Section will be in the classrooms this week ± Project 5 posted. Due Thurs Nov 5 at 11pm ± Prelim 2 on Nov 10. Email Randy Hess ( [email protected] ) if you have a conflict.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Oct 27, 2009 Lecture 17 2 Characters & strings ± We have used strings already: ± n= input(‘Next number: ’) ± sprintf(‘Answer is %d’, ans) ± A string is made up of individual characters, so a string is a 1-d array of characters ± CS1112 rocks! ’ is a character array of length 13; it has 7 letters, 4 digits, 1 space, and 1 symbol. C S 1 1 1 2 r o c k s !
Background image of page 2
Oct 27, 2009 Lecture 17 3 Single quotes enclose strings in Matlab Anything enclosed in single quotes is a string ( even if it looks like something else ) ± ‘100’ is a character array (string) of length 3 ± 100 is a numeric value ± ‘pi’ is a character array of length 2 ± pi is the built-in constant 3.1416… ± ‘x’ is a character (vector of length 1) ± x may be a variable name in your program
Background image of page 3

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

View Full DocumentRight Arrow Icon
Oct 27, 2009 Lecture 17 4 Numerical data is often encoded in strings. E.g., a file containing Ithaca weather data begins with the string W07629 N4226 meaning Longitude: 76 o 29’ West Latitude: 42 o 26’ North
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/06/2010 for the course CS 9339 taught by Professor Gries during the Fall '09 term at Cornell University (Engineering School).

Page1 / 15

L17post - Previous Lecture Working with images Todays Lecture Characters and strings Announcements Section will be in the classrooms this week

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

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