Filter löschen
Filter löschen

Is it possible to have a vector input to a Simulink if-statement block?

9 Ansichten (letzte 30 Tage)
I am working on vectorising my model and I got stuck when I tried to vectorise the if-statement block. I wonder if it is possible to do it in Simulink. I know that it will work if I get each singal individually and apply them to multiple of if-statement blocks, but this is not what I want to do. Any suggestions will be greatly appreciated!
This is what I want to do and the error that I get:

Akzeptierte Antwort

Drew Davis
Drew Davis am 26 Jun. 2015
You can only apply scalars to the if port of action subsystems. Consider your example where you test:
out1_of_if_block = u1 == [1 2] = [1 0]
What do you expect the If Action Subsystem2 to do when [1 0] is applied to the action port?
Perhaps inside of the 'If' block, you would want to do something more like this:
u1(1) == 1
  3 Kommentare
Tyene Zanella
Tyene Zanella am 12 Jul. 2018
Can u please show me how u did it? I'm having the same problem ):
Franco Ruiz
Franco Ruiz am 2 Aug. 2019
@Ahmed Rashid @Tyene Zanella Any advice I am dealing with the same problem?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Test Model Components finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by