How do I detect if I’m running MATLAB or Octave? May 24, 2023 by Tarik You could use the following test to differentiate Octave from MATLAB: isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0;