23MAT107 Calculus Lab1
23MAT107 Calculus Lab1
23MAT107
Calculus
Lab Practice Sheet-1
Creation of vectors, matrices, vector operations and matrix operations
➢ Go to Octave online / MATLAB and type the following in the command prompt
• length(x), length(y)
• size(A), size(B)
• B’, transpose(B)
• eye(4)
Creation of identity matrix
eye(5,8)
• z2=5:3:26 a:c:b
z3=26:-3:5 Creation of a row vector from a to b with an increment of c
• L=[1,2,3;4,5,6;7,8,9;8,3,4]
u=L(2,:)
extracts the specific rows, columns, submatrices
v=L(:,3)
w=L(1:2,2:3)
• E=[2,9,12;9,6,-2;2,8,10]
a=E(2,3)
Extracts a specific element from matrix
b=E(1,2)
• dot(p,q)
dot product and cross product of vectors
• cross(p,q)
7. Create a column vector of all numbers corresponding to the alphabets in your name.
8. Create a 1 x 5 vector A with all elements equal to 0 (without directly entering the rows).
9. Create a 4 x 5 matrix of all zero elements.
10 3 13
10. Create the following Matrix P=[44 21 62]
7 35 49
a. Find the transpose of P;
b. Display the element P13 of the matrix P.
c. Display the second row of the P.
d. Display the third column of P
e. Find the determinant of P
f. Find the inverse of P
g. Multiply P-1P and PP-1
h. Find PPT and PTP
i. Create a matrix which has elements as square of each element of P.
j. Find P3.
k. Create a matrix which has 2 added to each element of P.
l. Find the trace of the following matrices: P-1P, PTP, 3P, -P
11. Use MATLAB commands to create the following matrices (do not enter the matrices directly):
12. Create a diagonal matrix with the diagonal elements as elements of the vector [2, -6, 7, 3, 2, 7].