On 2020/04/10 16:17, PhilipNienhuis wrote:
José Luis García Pallero wrote
Hello,
Sometimes I need to check if a function or script is running in Octave
or Matlab. Usually I make the check as
if exist('OCTAVE_VERSION')
octave = 1;
else
octave = 0;
end
Is this the FASTEST way to check the environment or is there any other
method more suitable?
We have more or less the same in a function "ïsOctave.m" (maybe even with a
persistent variable inside). That function lives in our script library (a
collection of dedicated m-file subdirs) that is in a path set up in a
startup script called by both Matlab and Octave.
No idea if it's faster (I do suspect some function calling overhead) but as
a function it's easy to put in an if clause:
if (isOctave)
...
else
...
end %if
Philip
--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
I tried isOctave with following results
>> isOctave
error: 'isOctave' undefined near line 1 column 1
>>
Is there a package that I should load? I run Octave 5.2 on
Ubuntu 18.04.3
--
Steph