Commit | Line | Data |
---|---|---|
54255896 AIL |
1 | %% Taken from the GNU Octave Manual, (c) 1996-2016 John W. Eaton |
2 | %% https://octave.org/doc/v4.0.3/How-to-distinguish-between-Octave-and-Matlab_003f.html | |
3 | ||
4 | %% | |
5 | %% Return: true if the environment is Octave. | |
6 | %% | |
7 | function retval = isOctave | |
8 | persistent cacheval; % speeds up repeated calls | |
9 | ||
10 | if isempty (cacheval) | |
11 | cacheval = (exist ("OCTAVE_VERSION", "builtin") > 0); | |
12 | end | |
13 | ||
14 | retval = cacheval; | |
15 | end |