You are on page 1of 4

Experiment – 1

Aim : Creating a One and Two-Dimensional Array


(Row/Column Vector) (Matrix of given size) then,
(A).Performing Arithmetic Operations – Addition,
Subtraction, Multiplication and Exponentiation.
(B).Performing Matrix Operations – Inverse, Transpose,
Rank with plots.
A:
a= [4 3; 5 6]
a=
4 3
5 6
>>b=[3 1 ; 2 3]
B=
3 1
2 3
>>a+b
7 4
7 9
>>a-b
1 2
-2 3
>>a*b
18 13
27 23

B:
A=[2 3 4 ; 5 6 7 ; 8 9 0]
A=
2 3 4
5 6 7
8 9 0
>>inv(A)
Ans=
-2.1000 1.2000 -0.1000
1.8667 -1.0667 0.2000
-0.1000 0.2000 -0.1000
>>B=A’
B=
2 5 8
3 6 9
4 7 0
>>K=rank(A)
K=
3

You might also like