[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab rref equivalent?

From: Dirk Laurie
Subject: Re: Matlab rref equivalent?
Date: Tue, 16 May 2000 08:46:52 +0200 (SAST)

=?ISO-8859-1?Q?St=E9fan_van_der_Walt?= skryf:
> Hi,
> How do one reduce a matrix to row echelon or reduced row echelon form in
> Octave? (rref func in matlab for example)
> Regards,
> Stefan van der Walt

function [R,k]=rref(A,tol)
% reduced row echelon form
[m,n]=size(A); p=max(m,n);
if nargin<2, tol=p*eps*norm(A,inf); end
  % pad matrix with zeros to make it square
if m~=n, A(p,p)=0; end
  % remove added columns if any, add correct number of zero rows
if n<p, R(:,n+1:p)=[]; end
if length(k)<m, R(m,n)=0; end


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]