% Is a matrix strictly diagonally dominant % CONVERT THIS TO A FUNCTION exactly ASKED FOR in the problem statement clc A=[12 3 4; 4 -12 6; 12 12 25] % size of matrix n=length(A) % count used as a counter as for how many rows the inequality is met count=0 for i=1:1:n % finding the right hand side of the inequality sum=0 for j=1:1:n if i~=j sum=sum+abs(A(i,j)) end end % Comparing the LHS and RHS of inequality if abs(A(i,i))>sum count=count+1 end end % If the inequality is satisfied for all rows then the matrix is strictly % diagonaly dominant, else it is not strictly diagonally dominant. if count==n fprintf('Strictly diagonally dominant') else fprintf('Not strictly diagonally dominant') end