help-octave
[Top][All Lists]
Advanced

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

Matlab and Octave Compared: The "\" Operator


From: Craig Stoudt
Subject: Matlab and Octave Compared: The "\" Operator
Date: Fri, 12 Oct 2001 09:45:24 -0700 (PDT)

I've noticed a big difference in the performance of
the "\" operator in Matlab and Octave.  The difference
is rather striking when attempting to solve an
ill-conditioned linear system.

To explore this difference, I ran the following simple
script, which generates a series of linear systems
from order 1 to 100 using the hilbert matrix; a "ones"
vector is used to generate a solution vector, and then
the backslash operator is used to recover the "ones"
vector.  I used root mean square error as a metric to
compare the performance of Matlab and Octave (stored
in "v").

for n=1:100
  A=hilb(n);
  b=ones(n,1);
  y=A*b;
  b1=A\y;
  v(n)=sqrt(mean((b-b1).^2));
end

I ran this script on both Octave (2.1.31) and Matlab
(6.1.0.450 Release 12.1) on the same machine (Windows
2000).

The good news is that Octave appears to outperform
Matlab by 2-3 orders of magnitude for n greater than
10.  My question is: why?  Perhaps someone well-versed
in numerical methods could explain the difference in
performance?  I'm really curious.

Craig Stoudt
Annandale, Virginia

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



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

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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