Lecture 2-02 - Format is a string containing “ converasion

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

View Full Document Right Arrow Icon
Ability to understand matlab command Best way to study is keep using matlab Cont. Matlab Implementation of Casting Look at the table near the end of a chapter. Hw 4: when plotting: x-axis is a log scale (1, 10, 100, 1000, etc) The graph starts high, droops low, and goes back up like a W or U Part 2: when graphing, the object is to take an interval of the original and blow it up FIX A CUBIC MATLAB COMMAND TO THIS PLOT Then find the minimum frequency that we can hear. (its on the interval) Interger>> strings Number >> string Disp o Disp(…): gives some control over how the value will be displayed, but often not enough. It is also pretty tiresome to have to explicitly convert a numer to a character string Fprintf o Fprintf(format, A); causes the value(s) in the variable A to appear in the command window according to the format.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the 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.

Page1 / 2

Lecture 2-02 - Format is a string containing “ converasion

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

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