From 18ad927c9e78f3dcc18830b519b047c5d4940fba Mon Sep 17 00:00:00 2001 From: David Protzman Date: Mon, 18 Apr 2022 23:55:24 -0400 Subject: [PATCH] Added script to tell if running in Octave or not --- matlab/updated_scripts/is_octave.m | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 matlab/updated_scripts/is_octave.m diff --git a/matlab/updated_scripts/is_octave.m b/matlab/updated_scripts/is_octave.m new file mode 100644 index 0000000..bb44941 --- /dev/null +++ b/matlab/updated_scripts/is_octave.m @@ -0,0 +1,8 @@ +% Used to check if the script is running in Octave or MATLAB +% +% Logic is from https://stackoverflow.com/questions/2246579/how-do-i-detect-if-im-running-matlab-or-octave +% +% @return val True if the current script is running inside Octave, false if MATLAB +function [val] = is_octave() + val = exist('OCTAVE_VERSION', 'builtin') ~= 0; +end