Beruflich Dokumente
Kultur Dokumente
MATLAB WORKSHOP
MATLAB
An Introductory Workshop
Tutorial 3
Mathematical Applications
Tutorial 3
Akhilesh Shende
Mathematical Applications
MATLAB WORKSHOP
% dot product
Euclidean Norm
v = ai + bj
w = ci + dj
v.w = ac + bd
a = [1 2 3];
b = [4 5 6];
c = dot(a,b)
Tutorial 3
Akhilesh Shende
Mathematical Applications
MATLAB WORKSHOP
Tutorial 3
Akhilesh Shende
Mathematical Applications
MATLAB WORKSHOP
Linear Algebra
% Solving a Linear System
5x = 3y - 2z + 10
8y + 4z = 3x + 20
2x+ 4y -9z = 9
% Rearrange equation
5x - 3y + 2z = 10
-3x + 8y + 4z = 20
2x + 4y - 9z = 9
% Solution
A = [5 -3 2; -3 8 4; 2 4 -9];
b = [10;20;9];
x = b/A
x = A\b
x = inv(A)*b
% Reminder
Ax = b
x-?
x = b/A
x = inv(A)*b
Tutorial 3
Akhilesh Shende
Mathematical Applications
MATLAB WORKSHOP
Av v
A 0
V = matrix of eigen vector of A column wise
1st column of V = 1st eigen vector
D = matric eigen values of A on its diagonal
% extract what you want
v2 = V(:,2) % 2nd Column of vector
lam2 = D(2,2)
% 2nd eigen value
A*v2 - lam2*v2
% difference between A*v and lambda*v
Applications
Real Symmetric Matrix
A = gallery('lehmer',4) % symmetric positive definite matrix
Nonsymmetric Matrix
A = gallery('circul',3) % ciculant matrix
a Matrix Whose Elements Differ Dramatically in Scale
Tutorial 3
Akhilesh Shende
Mathematical Applications
MATLAB WORKSHOP
Curve Fitting
% Curve fitting
1. No magical function give you relationship
2. Idea about the function
3. Fitting by toolbox
Tutorial 3
% Caution
ployfit of higher order
Akhilesh Shende
Mathematical Applications
MATLAB WORKSHOP
Matrix Functions
det
diag
eig
inv
norm
rank
Determinant
Diagonal matrices and diagonals of a matrix
Eigenvalues and eigenvectors
Matrix inverse
Matrix and vector norms
Number of linearly independent rows or columns
Tutorial 3
Akhilesh Shende
Mathematical Applications
MATLAB WORKSHOP
Akhilesh Shende