[Top][All Lists]

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

Re: octave to matlab conversion

From: Søren Hauberg
Subject: Re: octave to matlab conversion
Date: Thu, 06 Oct 2005 23:15:43 +0200

tor, 06 10 2005 kl. 16:51 -0400, skrev Ben Barrowes:
> Does anyone have a handy piece of code to convert octave-style m-files to 
> matlab-style
> m-files?
I haven't used it, but there's an oct2mat on the octave-forge site. 
The link is

> This is becoming relevant as octave's source is many times used in a matlab 
> setting when one
> does not want to buy ML toolboxes, case in point, the statistics or signal 
> processing
> toolboxes. Or at times when octave-style source is better/more available than 
> the
> corresponding ML source.
It's great that people want to use octave, but it's really a shame if
price is the driving force. Octave should be used, because you can't (or
at least shouldn't) do science when working on a "black-box" system like
matlab. So please tell people to use octave because of the freedom and
because of the price. At least that's my opinion.

> This converter does not need to be very complicated... I am thinking of the 
> obvious things 
> # => %
> ! => ~
> endfunction => end
I think (haven't used matlab in a long time) you can't end a function in
matlab with a keyword, only end-of-file, or a new function.

> BTW, is there any reason that these different conventions were adopted aside 
> from stylistic
> considerations? The endfunction and its cousins (endofr, etc.) are more 
> explicit and
> understandable, but why a new comment character?
I don't know the reason, but it might be related to # being the standard
shell script comment. With octave supporting comments beginning with #,
it is possible to create an octave script that can be launched from the
terminal, by setting the she-bang (I think that's what it's called) to


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]