Appendix A

Syntax Quick Reference

This appendix gives examples of the most commonly used MATLAB syntax in this book (see Table A.1).

Table A.1

Operator Precedence (See Help on operator precedence)

Precedence Operators
1. ( )
2. ˆ .ˆ ’ .’ (pure transpose)
3. + (unary plus) - (unary minus) (NOT)
4. * / \ .* ./ .\
5. + (addition) - (subtraction)
6. :
7. > < >= <= ===
8. & (AND)
9. | (OR)

A.1 Expressions

image

A.2 Function M-files

image

A.3 Graphics

A.4 if and switch

A.5 For and while

A.6 Input/output

A.7 load/save ...

Get Essential MATLAB for Engineers and Scientists, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.