Skip to content

Commit

Permalink
Use matlab's -batch option for running external scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kümmerer <[email protected]>
  • Loading branch information
matthias-k committed Aug 14, 2024
1 parent cb63d3b commit 9e7744c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pysaliency/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ def run_matlab_cmd(cmd, cwd=None):
matlab = get_matlab_or_octave()
args = []
if os.path.basename(matlab).startswith('matlab'):
args += ['-nodesktop', '-nosplash', '-r']
args.append("try;{};catch exc;disp(getReport(exc));disp('__ERROR__');exit(1);end;quit".format(cmd))
#args += ['-nodesktop', '-nosplash', '-r']
#args.append("try;{};catch exc;disp(getReport(exc));disp('__ERROR__');exit(1);end;quit".format(cmd))
args += ['-batch', cmd]
else:
args += ['--traditional', '--eval']
args.append("try;{};catch exc;struct_levels_to_print(10);print_struct_array_contents(true);disp(lasterror);for i=1:size(lasterror.stack);disp(lasterror.stack(i));end;disp('__ERROR__');exit(1);end;quit".format(cmd))
Expand Down

0 comments on commit 9e7744c

Please sign in to comment.