{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

E7_Lecture2_Su10+posted

# E7_Lecture2_Su10+posted - Matlab basics Starting Matlab...

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

E7 L2 1 Matlab basics Starting Matlab double-click the Matlab icon, or use Start, Run…, type matlab , and return The Command Window and the Matlab prompt >>

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

View Full Document
E7 L2 2 Matlab as a calculator Matlab as a calculator Type expressions at the >>, and press return Result is computed, and displayed as ans Use numbers, +, *, /, -, (), sin, cos, exp, abs, round,…
E7 L2 3 Entering Commands and Expressions 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.

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

View Full Document
E7 L2 4 Scalar Arithmetic Operations 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 5 Order of Precedence Order of Precedence Precedence Operation First what is inside Parentheses , evaluated starting with the innermost pair. Second Exponentiation , evaluated from left to right . Third Multiplication and division with equal precedence, evaluated from left to right . Fourth Addition and subtraction with equal precedence, evaluated from left to right .

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

View Full Document
E7 L2 6 Examples of Precedence Examples of Precedence >> 8+3 * 5 ans = 23 >> 8 + (3 * 5) ans = 23 >>(8 + 3)*5 ans = 55 >> 4^2-12- 8/4*2 ans = 0 >> (4^2)-12- ( 8/4 ) *2 ans = 0 >> 4^2-12- 8/(4*2) ans = 3
E7 L2 7 Special Variables and Constants Special Variables and Constants Symbol Description ans most recent answer.

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.

{[ snackBarMessage ]}

### Page1 / 25

E7_Lecture2_Su10+posted - Matlab basics Starting Matlab...

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

View Full Document
Ask a homework question - tutors are online