This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Format is a string containing “ converasion specifications”,and/or labeling characters, and/or non-prinnt excape characters such as new line (\n) or tab (\t). Example • Fprintf(‘ pi to 3 decimals is %5.3f\n’, pi); • Produces the value of pi to 3 decimal places in the command window • 3.142 • The conversion specification here is %5.3f which is used to convert the numerical value of pi into characters (like num2str) but specifically asking for a minimum total number of characters (called the field width) of 5, with 3 pleaces to the right of the decimal. \n and >> • X= 3; y = 4.3; • Fprintf(‘%5d’,x); • Fprintf(‘%5.3f’,y); • Produces • 34.300>> • Just as if I had use Lecture 2/04: Imput and Output files...
View Full Document
This note was uploaded on 03/10/2011 for the course GEOGRAPHY 101 taught by Professor Lee during the Spring '11 term at American River.
- Spring '11