level 1
阿汉gg
楼主
%MaxPivot(A,currentRow,column)
%returns a row index i such that the absolute value of A(i,column) is maximum among A(currentRow,column),A(currentRow+1,column),...,A(m,column)
function[result] = MaxPivot(A,currentRow,column)
[m,n] = size(A);
temp = 0;
for j = currentRow:m
if abs(A(j,column)) > abs(temp)
temp = A(j,column);
i = j;
end
end
result = i;
2011年09月10日 16点09分
1
%returns a row index i such that the absolute value of A(i,column) is maximum among A(currentRow,column),A(currentRow+1,column),...,A(m,column)
function[result] = MaxPivot(A,currentRow,column)
[m,n] = size(A);
temp = 0;
for j = currentRow:m
if abs(A(j,column)) > abs(temp)
temp = A(j,column);
i = j;
end
end
result = i;