help-octave
[Top][All Lists]
Advanced

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

Re: matlab and octave


From: David Bateman
Subject: Re: matlab and octave
Date: Tue, 18 Nov 2003 15:57:51 +0100
User-agent: Mutt/1.3.28i

According to Geraint Paul Bevan <address@hidden> (on 11/18/03):
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Laurent Jacques wrote:
> 
> | ---- ismatlab.m
> | function out = ismatlab()
> | %% Return 1 if you are in matlab and 0 if you are in octave
> 
> 
> There are a number of ways of checking whether Matlab or Octave is being
> used, but they all depend on checking for some difference between the
> programs other than the one which the user is trying to protect against.
> 
> Considering that there is now an effort to increase compatability with
> Matlab, this could be problematic if the differences which are exploited
> cease to exist in the future.
> 
> Ideally, there would be agreement with Mathworks for a standard function
> ~ to return the name of the interpreter being used so that users could
> write, for instance,
> 
> if (interpreter == matlab)
>       something
> elseif (interpreter == octave)
>       something else
> else
>       error
> end


I tend to use

if (exist('OCTAVE_VERSION'))
  % Octave code
else
  % Matlab code
end

Is there something else that can even parse dot-m files than Matlab and
Octave? Why can't we just assume if its not octave, its matlab.

> 
> Has anyone ever tried to get such agreement with Mathworks or does
> anyone have any idea if they might be amenable to such a thing?
> 

Why do we need Mathworks consent in this case, unless they create an
inbuilt variable OCTAVE_VERSION just to annoy octave users.

The original auther might also want to look at the "automatic_replot"
internal variable

Regards
David


-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



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