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:
- 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.
- 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:
- Simulink display block: https://www.mathworks.com/help/simulink/slref/display.html
- MATLAB function block: https://www.mathworks.com/help/simulink/ug/what-is-a-matlab-function-block.html
- Simulink strings: https://www.mathworks.com/help/simulink/ug/simulink-strings.html
I hope this will help you in implementing your requirements.