E7_Lecture2_F08 - Matlab as calculator

E7_Lecture2_F08 - Matlab as calculator - 1 E7: INTRODUCTION...

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

View Full Document Right Arrow Icon
1 E7: INTRODUCTION TO COMPUTER ROGRAMMING FOR SCIENTISTS AND PROGRAMMING FOR SCIENTISTS AND ENGINEERS Lecture Outline 1. Matlab basics 2. Matlab as a calculator 3. Saving andloading files in matlab opyright 2007 Horowitz Packard This work is licensed under the Creative Commons Attribution- hare E7 L2 Copyright 2007, Horowitz, Packard. This work is licensed under the Creative Commons Attribution Share Alike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. 2 Matlab basics he default MATLAB Desktop The default MATLAB Desktop E7 L2 3 Matlab basics tarting Matlab Starting Matlab double-clickthe Matlabicon, or use Start, Run…, type matlab , and return The Command Window and the atlab prompt > E7 L2 Matlab prompt >> 4 Matlab basics • The Desktop menu – undocking and tiling windows • command • command history • workspace urrent directory • current directory he elp enu E7 L2 • The Help menu
Background image of page 1

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

View Full DocumentRight Arrow Icon
5 Matlab as a calculator ype expressions at the >> and press return • Type expressions at the >>, and press return • Result is computed, andd isplayed as ans • Use numbers, +, *, /, -, (), sin, cos, exp, abs, round,… OTE: NOTE: • In the next slides I will show examples of the use of matlab in powerpoint. E7 L2 pp The powerpoint output format is not exactly equal to the actual matlab output. 6 Entering Commands and Expressions • MATLAB retains your previous keystrokes. • Use the up-arrow key to scroll back back through the commands. • Use the down-arrow key to scroll forward. Edit a line using the left- and right-arrow keys the Backspace key, and the Delete key. • Press the Enter key to execute the command. E7 L2 7 Scalar Arithmetic Operations Symbol Operation MATLAB form ^ exponentiation: a b a^b * multiplication: ab a*b / right division: a/b a/b \ left division: b/a a\b + addition: a + b a + b - subtraction: a - b a - b E7 L2 8 Order of Precedence Precedence Operation First Parentheses, evaluated starting with the innermost pair.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/01/2009 for the course ENGLISH 7 taught by Professor Sengupta during the Spring '09 term at University of California, Berkeley.

Page1 / 7

E7_Lecture2_F08 - Matlab as calculator - 1 E7: INTRODUCTION...

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

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