Answer:
Check the explanation
Step-by-step explanation:
MATLAB code:
%----------------------
function result = dominant(A)
% matrix dimensions
d = size(A);
% for loop over rows
for i = 1:d
% sum of row elements except diagonal element
sum_row =0;
% for loop over columns
for j = 1:d
% adding each elements to sum variable
sum_row = sum_row+ abs(A(i,j));
end
%subratcting diagonal element
sum_row = sum_row-abs(A(i,i));
%checking dominant condition
% failed once means matrix is not diagonal dominant
if abs(A(i,i))< sum_row
result = 'false';
return;
end
end
% dominant condition not failed
result = 'true';
end
% matrix A
A = [ 3 -2 1; 1 -3 2; 1 2 6]
% result
result = dominant(A)
% matrix A
A = [ -2 1 2; 1 3 2; 1 -2 0]
% result
result = dominant(A)
%----------------------
Kindly check the attached output image below.