how to display text in simulink?

21 次查看(过去 30 天)
is it possible to make the display block output text? I want to display 3 words based on output from Simulink block

回答(1 个)

Abhipsa
Abhipsa 2025-3-5
I understand that you want to display words according to the output produced by a Simulink block.
You can achieve this by using the MATLAB function block and the Simulink display block which is present in Simulink > Sink.
You can follow these steps to achieve the same:
  1. Create a MATLAB function block which will contain the logic of displaying the desired output word or string according to the Simulink block’s output.
  2. Connect the MATLAB is function block with the Simulink output block such that the MATLAB function block receives input from it.
Connect a Simulink display block to the output signal of MATLAB function block.
For a better understanding you can refer to the sample model below:
Please ensure to keep your output words in double quotes, so that it will be recognised as a Simulink string.
Please refer to the MATLAB documentation of “Simulink Strings” for more details:
I hope this will help you in implementing your requirements.

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by