function [sdd]=checksdd(A) n=length(A); for k=1:n %c hecking sdd property in each row sum1=0; % reinitializes sum1 for each row for j=1:n % forms the sum of off diagonal entries sum1=sum1+abs(A(k,j)); % adds all the entries in the kth row end sum1=sum1-abs(A(k,k)); % subtracts the diag entry from sum1 if abs(A(k,k))>sum1 %checks the sdd property for the kth row check(k)=0; % if sdd holds else check(k)=1; % if sdd is false end end if sum(check)==0 %look at the sum of the entries in check sdd=1; else sdd=0; end