I'm using the sim command in a Matlab script to run a Simulink model. This simulink model display some stuff in the command window. What is the option for the sim command to remove any display that would go in the command window? So is there something similar to this that exist :
sim('model', 'CommandWindowDisplayVisible', 'off');
Update:
From what I found, there appears to be no such thing possible with the sim command. Here what I did as an alternative :
s = sprintf('sim(''%s'')', ModelName);
try
evalc(s);
catch err
msgString = getReport(err, 'extended');
disp(msgString)
end
You could try using evalc to capture the output to a variable. This way it is not displayed in the command window.
for example
sim('model')
produces output, whereas:
myCommandWindowOutput = evalc('sim(''model'')');
doesn't.
In fact, you don't even need to assign the output, you could just write:
evalc('sim(''model'')');
http://www.mathworks.co.uk/help/matlab/ref/evalc.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With