Reputation: 2332
Before you answer, I'm not looking for the functionality of ;
to suppress command line printing.
I have a set of scripts which are not mine and I do not have the ability to change. However, in my scripts I make a call to these other scripts through evalin('base', 'scriptName')
. Unfortunately, these other scripts do a lot of unnecessary and ugly printing to the command window that I don't want to see. Without being able to edit these other scripts, I would like a way to suppress output to the command line for the time that these other scripts are executing.
One potential answer was to use evalc
, but when I try evalc(evalin('base', 'scriptName'))
MATLAB throws an error complaining that it cannot execute a script as a function. I'm hoping there's something like the ability to disable command window printing or else redirecting all output to some null file much like /dev/null
in unix.
Upvotes: 1
Views: 2154
Reputation: 9864
I think you just need to turn the argument in your evalc
example into a string:
evalc('evalin(''base'', ''scriptName'')');
Upvotes: 1
Reputation: 3071
I don't know if it will fit your needs, but another solution can be to open a new session of Matlab, and use there only minimized -nodesktop
form (-just the command window). You can run from there the annoying scripts, and work on the main session as usual.
The problem here is that the sessions can't be synchronized, so if you need to work with the results of the scripts all the time, it'll be a little bit complicated. Maybe you can save the result to disk, than call it from the main session... But it mainly depends on your workflow with those scripts.
Upvotes: 0