help-octave
[Top][All Lists]
Advanced

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

Re: octave to matlab conversion


From: Andy Adler
Subject: Re: octave to matlab conversion
Date: Mon, 7 Nov 2005 10:28:03 -0500 (EST)

On Mon, 7 Nov 2005, John W. Eaton wrote:

> On  7-Nov-2005, Ben Barrowes wrote:
>
> | With this conversion function, I am thinking to include directories
> | which would include every m-file that comes with octave and
> | octave-forge.
>
> You are free to do this if you wish, but why?  One of the goals of
> Octave is to provide a free alternative to Matlab.  It is not intended
> to provide improvements to the proprietary Matlab.

The advantage I can see if for projects that are designed to support
both Octave and Matlab. For example, I am an author of EIDORS
(eidors.sf.net) a package for image reconstruction in soft field
tomography.

This project aims to be Octave/Matlab supporting, but users
will make contributions that work with their system, and may
not work on the other. It would be great to have an automated
script to detect (and correct) code which is not cross-language.

That said, it seems bizarre to write this code in Octave
since it is a text processing job. Why not use something like
perl. How about (warning untested code).

#!perl -w -p
    s/^#/%#/;
    s/\\\s*$/.../;
    s/(\b|\s) ~= (\b|\s)/!=/gx;
    s/\b endif \b/end/gx;

... etc.


On the other hand, to make a really robust converter needs a proper
parser. One way to do that would be to base it on the flex code in
octave.

--
Andy Adler <address@hidden> 1(613)562-5800x6218



-------------------------------------------------------------
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]