When you have matrices with special structures and symmetries, Julia can encode 
that information in the type of the matrix, and in those cases the backslash 
operator should actually be more efficient than in Matlab because there is no 
need to “guess” what the best algorithm might be. My understanding is that no 
such thing exists in Matlab. Having said that, take this with a grain of salt, 
this is not my area of expertise (neither in Julia nor in Matlab).

 

The relevant Julia manual section is 
http://docs.julialang.org/en/latest/manual/linear-algebra/.

 

From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On 
Behalf Of Art Kuo
Sent: Wednesday, September 30, 2015 9:30 AM
To: julia-users <julia-users@googlegroups.com>
Subject: Re: [julia-users] Re: What's the reason of the Success of Python?

 

> (x=inv(A)*b) than it is in many other languages.  Julia has at least this 


You shouldn't ever do this (in either Julia or Matlab, or any language), 
it is ill-conditioned for general matrices. I think the Matlab function 
is linsolve. 

Perhaps more precise to say  "A\b is always faster than inv(A)*b, and more 
accurate if A is ill-conditioned." I also usually prefer Matlab's backslash or 
mldivide, A\b, over the more specific linsolve, because backslash chooses the 
right solver (including linsolve) most of the time, for systems that are 
sparse, over- or under-determined, etc. Julia also implements similar 
functionality, but I doubt if it is as optimized as Matlab, which has many 
years' advantage. As for the accuracy advantage, it is true that inv(A)*b can 
go wrong, and A\b will go less wrong. But Ill-conditioned A is usually an 
indicator that neither approach will be great.

 

Reply via email to