getting started 2d-plots matrix & linear equations
DESCRIPTION
Lecture 4. Matlab Basics. Getting started 2D-Plots Matrix & Linear Equations. Getting Started. Matlab program can be found at: apps.asu.edu. Getting Started. Tutorials and demos can be found at http://www.mathworks.com/products/matlab/demos.html?show=demo. - PowerPoint PPT PresentationTRANSCRIPT
Getting started
2D-Plots
Matrix & Linear Equations
Lecture 4. Matlab Basics
1
2
Getting Started
• Matlab program can be found at: apps.asu.edu.
3
Getting Started
• Tutorials and demos can be found at http://www.mathworks.com/products/matlab/demos.html?show=demo
• Getting Started with MATLAB (4 min 58 sec)
• Working in The Development Environment (4 min 13 sec)
• Writing a MATLAB Program (5 min 36 sec)
4
2D Plots
• Tutorials and demos for 2D plots can be found at
http://www.mathworks.com/products/matlab/demos.html?file=/products/demos/shipping/matlab/graf2d.html
5
Matrix and Linear Equations
• Linear Equations (n-variables and m-equations)
11212111 ... bxaxaxa nn
22222121 ... bxaxaxa nn
mnmnmm bxaxaxa ...2211
…..
• Matrix representation
Ax=b
6
Matrix and Linear Equations
• Matlab representation
Ax=b• Matrix representation:
mnmm
n
n
aaa
aaa
aaa
A
...
......
...
...
21
22221
11211
nx
x
x
x.1
1
mb
b
b
b.1
1
• Solution: x=A-1b
x=b/A
7
Matrix and Linear Equations
• An example
032 321 iii
• Solve the problem with Matlab
>> A=[-2 1 3;1 1 0; 0 3 -1]
5.121 ii03 32 ii
130
011
312
A
0
5.1
0
b
>> b=[0;1.5;0]
>> i=b/A
Step 1
Step 2
Step 3
8
Matrix and Linear Equations
• What if
032 321 iii
• Solve the problem with Matlab
>> A=[-2 1 3;1 1 0; 0 3 -1]
siii 5.121 03 32 ii
130
011
312
A
0
5.1
0
sib
>> b=[0;1.5;0]
>> i=b/A
Step 1
Step 2
Step 3
Step 3 Multiply the results by is
9
Matrix and Linear Equations
• What if
sviii 232 321
• Using the superposition principle!
siii 5.121 03 32 ii
130
011
312
A
ss vib
0
0
2
0
5.1
0
the same
BUT
10
Matrix and Linear Equations
• Re-write the equation as
ss v
i
i
i
i
i
i
i
x
''
3
''2
''1
'3
'2
'1
Solve one at a time and add the results according to
0
5.1
0
130
011
312
'3
'2
'1
i
i
i
0
0
2
130
011
312
''3
''2
''1
i
i
i
and