SUNY Geneseo Department of Computer Science
Scripts
Friday, February 14
CSci 120, Spring 2014
Prof. Doug Baldwin
Return to List of Lectures
Previous Lecture
Misc
Quiz 1 ready to return
Questions?
input( ‘prompt’, ‘s’ )
vs input( ‘prompt’ )
?
- Difference between reading string vs number
- e.g., 17
- Read as a number, it is a mathematical abstraction between 16 and 18
- Read as a string, it is two digit characters (a &ldquo1” followed by a “7”)
Format characters in fprintf
?
- Represent places where values should be embedded in printed output
%s
= embed as a string
%f
= embed as a real number with decimal digits
%d
= embed as a base-10 (decimal) integer
%o
= embed as a base-8 (octal) integer
Next
Plotting, graphs, curves, etc.
Readings and mini-lectures
- Section 3.5 of Attaway’s text
- “Creating a Simple Plot” from Edinburgh
- The “Visualizing Data” and “Formatting Plots” sections of the “Working with the Matlab User Interface” chapter of MathWorks’ tutorials
- These describe interactive ways of creating and manipulating plots. We’re going to concentrate on commands that let programs create plots without help from users, but the interactive features and ideas can all be used from programs.
- The “Plane Curves” mini-lecture from Cengage Learning at http://college.cengage.com/mathematics/blackboard/shared/content/video_explanations/v01537a.html
Handout available online over weekend and on paper Monday / Wednesday
Next Lecture