Stop diagnostics from simulink model outputting to command line when using simout?

조회 수: 11 (최근 30일)
When I use:
simOut = sim(MyModel,'SimulationMode','Normal);
to run my simulink model, it appears to be printing the Diagnostics in the command window.
How can I stop this?
It doesn't happen when I run the simulink model directly in simulink, only when I'm using my custom guide GUI.
Thanks!
  댓글 수: 1
Keith Lewis
Keith Lewis 2017년 2월 9일
편집: Keith Lewis 2017년 2월 9일
Or how can I stop state flows from printing to diagnostics? That seems to be the main issue.

댓글을 달려면 로그인하십시오.

채택된 답변

Keith Lewis
Keith Lewis 2017년 2월 17일
I ended up just deleting the Stateflow chart and replacing it with a Matlab function because I could not get the Stateflow to stop printing to diagnostics and the command window despite turning off all the stateflow options in the diagnostics configuration in simulink. I still don't know what was causing it to print.

추가 답변 (1개)

Nirja Mehta
Nirja Mehta 2017년 2월 6일
As per my understanding of your question, I tried the following:
>> vdp
>> simOut = sim(gcs,'SimulationMode','Normal')
Output on command window was:
Simulink.SimulationOutput:
struct with no fields.
Use get to access a variable by name.
Use getSimulationMetadata to access metadata about the simulation.
If you want to suppress this, just put a semi-colon at the end of "simOut" statement:
>> simOut = sim(gcs,'SimulationMode','Normal');
  댓글 수: 1
Keith Lewis
Keith Lewis 2017년 2월 8일
Sorry yes I forgot the semicolon in my question, but I am already using that.
I think it's the diagnostics printing, but I'm not 100% sure that's just by comparing the output in the command line to the diagnostics viewer.
I don't know what's causing it to print out. Do you have any ideas? I've search for stray missing semi colons but I couldn't see any. Like I said it doesn't print the stuff when I run it directly from simulink so I'm assuming (possibly mistakenly) it's coming from the sim() function?
It's annoying because it prints everything from a stateflow chart (that I don't want to see) so data that I actually do want to look is getting lost.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by