Académique Documents
Professionnel Documents
Culture Documents
Matlab Basics
Brett Naul
January 7, 2015
What is Matlab?
1 C = A*B;
Goals
Basic Computations
Matlab’s Graphic User Interface
Default Layout
I Command Window
I The main window for executing commands
I Matlab’s “sandbox”
I Command History
I The history of commands executed
I Useful for recalling commands
Matlab’s Graphic User Interface
Default Layout
I Current Folder
I The working directory for saving and loading files
I Matlab functions written by you need to be in this
directory to work
I Workspace
I A list of the currently defined variables
I Data type and values are also displayed
Matlab’s Graphic User Interface
Other Windows
I Editor
I A text editor for writing and running scripts and
functions
I Also contains Matlab’s Debugger
I Figure Window
I An all-purpose visualization window for plotting of all
kinds
I 2-d plots, 3-d plots, surfaces, movies...
Matlab’s Graphic User Interface
Other Windows
1 EDU>> a = 10
2 a =
3 10
1 EDU>> realmax
2 ans =
3 1.7977e+308
4 EDU>> realmin
5 ans =
6 2.2251e−308
Numbers and arithmetic operations in Matlab
1 EDU>> i
2 ans =
3 0 + 1.0000i
I Complex Functions
I abs(), conj(), imag(), real()
I Rounding Functions
I round(), floor(), ceil(), mod()
I Order of Operations as usual
I (x(y + z))2 ⇒ (x*(y+z))^2
I You name it, Matlab’s got it
Exercises