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

Info icon This 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.
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern