1.matlab Week1
1.matlab Week1
Course Weightage
Attendance - 10%
Weekly Assignments – 20%
Course Project – 70% Week 1
Session-I
MATLAB as a Calculator
Getting Started
Controlling the appearance
format long ↵
format short ↵
disp(x) ↵ Week 1
Managing the workspace
clear, clearvars, clearvars –except, who
MATLAB as a Calculator
File Handling
Entering a vector A(row,col)↵
v1 = [1 2 5 8]↵ A(2,2) = 10 ↵
Entering a matrix Linear Spacing
1 4 2 2 𝑥 4𝑦 2𝑧 2
𝐴 2 3 2 𝑏 3 2𝑥 3𝑦 2𝑧 3
1 1 0 4 𝑥 𝑦 0𝑧 4
Ax = b x=A-1b
X = inv(A)*b x = A\b
Some Matrix Functions
det(A) diag(A) eig(A)
inv(A) norm(A) rank(A)