how to display text in simulink?

29 visualizzazioni (ultimi 30 giorni)
ahmedalkhair mostafa
ahmedalkhair mostafa il 13 Dic 2017
Risposto: Abhipsa il 5 Mar 2025
is it possible to make the display block output text? I want to display 3 words based on output from Simulink block

Risposte (1)

Abhipsa
Abhipsa il 5 Mar 2025
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.

Community Treasure Hunt

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

Start Hunting!

Translated by