[SciPy-user] Matlab, Scipy and teaching science

Cournapeau David cournape at atr.jp
Fri Oct 21 00:31:07 CDT 2005

On Thu, 2005-10-20 at 12:43 +0200, Robert Cimrman wrote:
> Tiziano Zito wrote:
> > We used Python for Computational Neuroscience teaching here:
> > 
> > http://itb.biologie.hu-berlin.de/~zito/teaching/CNSIV/index.html
> > 
> > Another strong arguments against Matlab is that it lacks any kind of
> > Object Oriented design. As already stated by others, that makes
> > practically impossible to reuse old code for new things and exchange
> > code with other people. Last argument is speed and memory
> > consumption. Part of our MDP Python library was originally written in 
> > Matlab: the corresponding Python versions are not only much shorter,
> > but at least two times faster. Python passes arguments to functions
> > as references, whereas Matlab uses copies: if you are dealing with
> > large matrices this makes a difference.
> Just a minor correction - Matlab passes arguments also by reference, but 
> it makes a *copy* of each argument that you change inside the function - 
> it can be (ugly)-hacked around though...
Matlab uses copy on write techniques, so the arguments as references
against arguments as copy does not hold.

	In my opinion, the main (technical) problem of matlab, by far, is that
there is only good support for arrays of double. From there comes the
memory consumption problem (eg: loading an audiofile in double is stupid
most of the time). From there comes the speed issue when using something
else than double arrays (matlab is arguably very fast in that domain for
linear algebra stuff on native arrays). Emulating list with cell array
is extremely slow, and cell array are really impractical to use
(indexing syntax is different for example).

	Now, the existing matlab codebase for domain such as signal processing
is huge, and without a way to interface matlab and python, I don't see
that changing soon, unfortunately. I am still using matlab in many
projects for that reason; I am using some ugly hacks to use python back
and forth inside matlab, but this is far from ideal.


More information about the SciPy-user mailing list