> I think you misread that response. I believe what Philip was saying that he put that code (starting with if exist(...)) in a file called isOctave. I don't believe there is a built in function to do what you're asking. The caveat was that, if you're looking for the FASTEST way, it would evoke some function call overhead than putting that code directly into your code, so it would be relatively slower than putting it inline.
is this something you're looking to do repeatedly? if so the Octave manual and wiki offer the following suggestion to use a persistent variable with is_octave so you only have to call exist once:
-----------------
%%
%% Return: true if the environment is Octave.
%%
function retval = isOctave
persistent cacheval; % speeds up repeated calls
if isempty (cacheval)
cacheval = (exist ("OCTAVE_VERSION", "builtin") > 0);
end
retval = cacheval;
end
-------------------