FINDPIV.M
资源名称:easy.zip [点击查看]
上传用户:sfyaiting
上传日期:2009-10-25
资源大小:320k
文件大小:0k
源码类别:
GPS编程
开发平台:
Matlab
- function [k,p] = findpiv(A,k,p,tol)
- %FINDPIV Used by PLU to find a pivot for Gaussian elimination.
- % [r,p] = FINDPIV(A(k:m,p:n),k,p,tol) finds the first element in
- % the specified submatrix which is larger than tol in absolute value.
- % It returns indices r and p so that A(r,p) is the pivot.
- [m,n] = size(A);
- r = find(abs(A(:))>tol);
- if isempty(r)
- return
- end
- r = r(1);
- j = fix((r-1)/m)+1;
- p = p+j-1;
- k = k+r-(j-1)*m-1;