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
- Spring '11
- Decimal, fprintf, MATLAB command, Fprintf o Fprintf, CUBIC MATLAB COMMAND