help-octave
[Top][All Lists]
Advanced

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

Re: Distinguishing Octave from Matlab


From: Søren Hauberg
Subject: Re: Distinguishing Octave from Matlab
Date: Fri, 15 Feb 2008 11:25:40 +0100

fre, 15 02 2008 kl. 11:02 +0100, skrev David Bateman:
> A function that does what you want is
> 
> function ret = isoctave ()
>   persistent isoct
>   if (isempty (isoct))
>      isoct = exist('OCTAVE_VERSION') ~= 0;
>   end
>   ret = isoct;
> end
Is the 'exist' call really so slow that you need to use a persistent
variable? Wouldn't it be just as good to use

function ret = isoctave ()
  ret = (exist('OCTAVE_VERSION') ~= 0);
endfunction

?

Søren



reply via email to

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