help-octave
[Top][All Lists]
Advanced

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

Re: Distinguishing Octave from Matlab


From: John W. Eaton
Subject: Re: Distinguishing Octave from Matlab
Date: Thu, 19 Feb 2009 12:36:28 -0500

On 19-Feb-2009, José Luis García Pallero wrote:

| Here, you have possible solutions:
| 
| http://www-old.cae.wisc.edu/pipermail/help-octave/2007-April/003809.html
| http://www-old.cae.wisc.edu/pipermail/help-octave/2007-May/003814.html

Probably the best solution is something similar to David's suggestion of:

  function in = inoctave ()
    persistent inout = exist("OCTAVE_VERSION","builtin") != 0;
    in = inout;
  endfunction

but that won't work in Matlab, so you'll need to write it as

  function retval = inoctave ()
    persistent inout;
    if (isempty (inout))
      inout = exist ('OCTAVE_VERSION', 'builtin') ~= 0;
    end
    retval = inout;
  end


If this isn't in the FAQ, it should be.

jwe



reply via email to

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