piv - cols=setdiff(1:n,col rows=setdiff(1:m,row...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function A=piv(Ain,row,col) %function A=piv(Ain,row,col) % pivot element (row,col) [m,n]=size(Ain); if Ain(row,col)<=0, disp('Warning: pivot element not positive'); end arow=Ain(row,:); pivot=Ain(row,col);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cols=setdiff(1:n,col); rows=setdiff(1:m,row); A=zeros(size(Ain)); for i=rows for j=cols A(i,j)=Ain(i,j)-Ain(i,col)*Ain(row,j)/pivot; end end A(row,:)=arow/pivot;...
View Full Document

This note was uploaded on 06/11/2011 for the course C 350 taught by Professor Wolkowicz during the Fall '97 term at Waterloo.

Ask a homework question - tutors are online