Skip to content
Permalink
a5a5f364e5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
24 lines (22 sloc) 480 Bytes
% [B, D] = zerodiag(A,altmin,varargin)
% Sets diagonal terms to zero
% D is the diagonal values
function [B, D] = zerodiag(A,altmin,varargin)
[sy,sx] = size(A);
B = A;
if sy~=sx
disp('in zerodiag not square');
B = A;
else
if nargin == 1
for loop = 1:sx
B(loop,loop) = 0;
D(loop) = A(loop,loop);
end
else
for loop = 1:sx
B(loop,loop) = altmin;
D(loop) = A(loop,loop);
end
end
end