a=[2,3,4;5,6,7;8,9,1;]
i=0,j=0;
[m,n] = size(a)
for i=1:m
for j=i:n
if i==j && a(i,j) ~=0 && a(i,j)~=1
a(i,:)=a(i,:)/a(i,j)
temp=a(i,:);
else if i~=j
a(j,:)=a(j,i)*a(i,:)-a(j,:)
end
end
end
end
i=0,j=0;
[m,n] = size(a)
for i=1:m
for j=i:n
if i==j && a(i,j) ~=0 && a(i,j)~=1
a(i,:)=a(i,:)/a(i,j)
temp=a(i,:);
else if i~=j
a(j,:)=a(j,i)*a(i,:)-a(j,:)
end
end
end
end
No comments:
Post a Comment