[Top][All Lists]

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

Re: Distinguishing Octave from Matlab

From: Ben Abbott
Subject: Re: Distinguishing Octave from Matlab
Date: Fri, 15 Feb 2008 11:43:25 -0500

On Feb 15, 2008, at 11:31 AM, David Bateman wrote:

Ben Abbott wrote:

On Feb 15, 2008, at 5:02 AM, David Bateman wrote:

Use Octave 3.0.0 and use the matlab syntax everywhere, in most cases it should then just work.. If there are any other differences that prevent it working then they should be reported as bugs. A function that does
what you want is

function ret = isoctave ()
persistent isoct
if (isempty (isoct))
   isoct = exist('OCTAVE_VERSION') ~= 0;
ret = isoct;


Might this be added to the core functions?


How does that help you if we can't convince mathworks to do the same?


Good point <blushing>

Perhaps an octave version of an existing Matlab function ("ver", "version", "verLessThan", ?) could do the job?

>> help verLessThan
 verLessThan Compare version of toolbox to specified version string.
    verLessThan(TOOLBOX_DIR, VERSION) returns true if the version of
    the toolbox specified by the string TOOLBOX_DIR is older than the
    version specified by the string VERSION, and false otherwise.
    VERSION must be a string in the form 'major[.minor[.revision]]',
    such as '7', '7.1', or '7.0.1'. If TOOLBOX_DIR cannot be found
    on MATLAB's search path, an error is generated.

        if verLessThan('images', '4.1')
error('Image Processing Toolbox 4.1 or higher is required.');

        if verLessThan('matlab', '7.0.1')
            % Put code to run under MATLAB older than MATLAB 7.0.1 here
            % Put code to run under MATLAB 7.0.1 and newer here

    See also matlabpath, ver.


reply via email to

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