1. How to print text in display block in Simulink? 2. Also how to make control condition in Switch statement to be "=0" ?

조회 수: 1 (최근 30일)
I am trying to write a block diagram to identify the number is odd or even and print it as the ouput.
I have developed the logic using switch block. I amtrying to use this pseudo code
if amod2=0
display "even"
else
display "odd".
This is the logic I have written for Odd number (Displayed as 1)
This is the logic I have written for Even number (Displayed as 2)
The logic is wokring to display as 1 or 2.
But I wish to display "Odd" or "Even" bsed on "=0" control condition.
Please guide me with this.

답변 (1개)

Swastik Sarkar
Swastik Sarkar 2023년 6월 27일
You can achieve this using the string constant block present in simulink
This is what it would look like:

카테고리

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

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by