k = 5 disp("Display a matrix") a1 = [1, 2, 3; 4, 5, 6] a2 = [-1, -2, -3; -4, -5, -6] disp(a1, a2) disp("Display a vector") v1 = [1, 2, 3] v2 = [4, 5, 6] disp(v1, v2) disp("--------------------------------") disp("Scalar and Vector:") disp("k + v1: ", k + v1) disp("k - v1: ", k - v1) disp("k * v1: ", k * v1) disp("v1 / k: ", v1 / k) disp("Element by Element v1 .^ k", v1 .^ k) disp("--------------------------------") disp("Scalar and Matrix:") disp("k + a1", k + a1) disp("k - a1", k - a1) disp("k * a1", k * a1) disp("a1 / k", a1 / k) disp("Element by Element a1 .^ k", a1 .^ k) disp("--------------------------------") disp("Vector and Vector:") disp("v1 + v2", v1 + v2) disp("v1 - v2", v1 - v2) disp("v1 .* v2", v1 .* v2) disp("v1 ./ v2", v1 ./ v2) disp("Element by Element v1 .^ v2", v1 .^ v2) disp("--------------------------------") disp("Matrix and Matrix:") disp("a1 + a2", a1 + a2) disp("a1 - a2", a1 - a2) disp("a1 .* a2", a1 .* a2) disp("a1 ./ a2", a1 ./ a2) disp("Element by Element a1 .^ a2", a1 .^ a2) disp("--------------------------------") disp("5x5 Matrix:") a3 = [ 1, 2, 3, 4, 5; 2, 3, 4, 5, 6; 3, 4, 5, 6, 7; 4, 5, 6, 7, 8; 5, 6, 7, 8, 9; ] disp(a3) disp("Element at 3rd row, 5th Column:", a3(3, 5)) disp("Element at 5th row, 2nd Column:", a3(5, 2)) disp("Elements in 2nd row:", a3(2,:)) disp("Elements in 3rd column:", a3(:,3)) disp("Submatrix with rows 4-5 and columns 2-3:",a3(4:5,2:3)) disp("Submatrix with rows 2-5 and columns 2-5:",a3(2:5,2:5)) disp("Entire Matrix:", a3(:,:)) a4 = a3