필터 지우기
필터 지우기

Printing debugging information simulink

조회 수: 24 (최근 30일)
Róbinson Medina Sánchez
Róbinson Medina Sánchez 2019년 7월 4일
댓글: Róbinson Medina Sánchez 2019년 7월 17일
Hi all
I basically have a simulink simulation that has a lot of matlab function blocks. The simulation is rather complex. Therefore, I would like to somehow display information about the current status of the simulation. I would like to visualize text and some variables. I have tried "fprintf" within the matlab functions, but my messages get piled up with a lot of simulink information in the "view diagnostics". Is there any block that allows me to display text in simulink? Or could I have a command that prints text in the workspace?
Thanks
Róbinson

답변 (1개)

Kritika Bansal
Kritika Bansal 2019년 7월 17일
Hi,
As per my understanding, you are trying to debug your Simulink model which contains MATLAB function blocks. You are looking for a way to display the values of the variables either by inserting a block in his simulation or by using a command that displays the values in the workspace.
There is a block called ‘Display’ in Simulink’s ‘Sinks’ library. You can add it either via the library browser or by double clicking the Simulink canvas and typing ‘Display’ and choosing the one present under ‘Simulink/Sinks’.
An alternative and a better solution would be to display the signal values directly on the signals (connections) of your Simulink model during the simulation and using ‘Step forward’ button instead of ‘Run’ to see the results of your simulation at each step.
More information can be found in the links below:
In case you specifically want to debug your MATLAB function blocks you can insert breakpoints in your MATLAB function and use the debugger. For more information on how to do that, use the link below:
  댓글 수: 1
Róbinson Medina Sánchez
Róbinson Medina Sánchez 2019년 7월 17일
Thanks for your answer.
Is it possible to display text in the block "Display"? I believe I cannot output text from the MATLAB function blocks.
I do not want to exactly debug my software since it is working fine. However, using simulink I am controlling external equipment which is sending status messages, e.g. Ready, In Error, stopped, etc. Therefore I would like to visualize permanently these messages.
Best
Róbinson

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

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by