Lecture 2-02

# Lecture 2-02 - Format is a string containing “...

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

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.

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

View Full Document
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern