Type I:
MATLAB CODE:
clc
clear all
close all
A = [4 2 3;-8 -7 -2;12 -9 34];
fprintf('Matrix A:\n')
disp(A)
S = size(A);
m = S(1); % Number of rows in matrix A
fprintf('NOTE:Matrix A is having %d rows only\n',m)
i = input('Enter row number for i:');
j = input('Enter row number for j:');
A([i,j],:) = A([j,i],:);
fprintf('Matrix after Rows %d and %d are interchaned:\n',i,j)
disp(A)
OUTPUT:
Type II:
MATLAB CODE:
clc
clear all
close all
A = [4 2 3;-8 -7 -2;12 -9 34];
fprintf('Matrix A:\n')
disp(A)
S = size(A);
m = S(1); % Number of rows in matrix A
fprintf('NOTE:Matrix A is having %d rows only\n',m)
i = input('Enter row number for i:');
a = input('Enter any number for a:');
A(i,:) = a*A(i,:);
fprintf('Matrix after Row %d multiplied by %d:\n',i,a)
disp(A)
OUTPUT:
Type III:
MATLAB CODE:
clc
clear all
close all
A = [4 2 3;-8 -7 -2;12 -9 34];
fprintf('Matrix A:\n')
disp(A)
S = size(A);
m = S(1); % Number of rows in matrix A
fprintf('NOTE:Matrix A is having %d rows only\n',m)
i = input('Enter row number for i:');
j = input('Enter row number for j:');
a = input('Enter any number for a:');
A(i,:) = A(i,:) + a*A(j,:);
fprintf('Matrix after Row %d is multiplied by %d and added to Row
%d:\n',j,a,i)
disp(A)
OUTPUT:
In Matlab explain how MMAIDAB gou that ansWer! 8. Perform row operations: The three elementary row operations can be per...
MATLAB ONLY gauss.jpg BELOW Instructions: The following problems can be done interactively or by writing the commands iın an M-file (or by a combination of the two). In either case, record all MATLAB input commands and output in a text document and edit it according to the instructions of LAB 1 and LAB 2. For problem 2, include a picture of the rank-1 approximation. For problem 3, include a picture of the rank-10 approximation and for problem 4, include a...