📄 ref.m
字号:
function [R,pivcol] = ref(A)
%REF Reduced Row Echelon Form.
% R = ref(A) uses the pivoting LU factorization computed by PLU
% to find the reduced row echelon form of a rectangular matrix A.
[P,L,U,pivcol] = plu(A);
% Scale rows so that pivots are one and eliminate
% nonzeros above the pivots.
R = U;
[m,n] = size(R);
for k = 1:length(pivcol);
p = pivcol(k);
for j = p+1:n
R(k,j) = R(k,j)/R(k,p);
end
R(k,p) = 1;
for i = 1:k-1
for j = p+1:n
R(i,j) = R(i,j) - R(i,p)*R(k,j);
end
R(i,p) = 0;
end
end
%%%%%%%%%%%%%%%%%%%%%%% end plu.m %%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -