Is it possible to have a vector input to a Simulink if-statement block?
조회 수: 21(최근 30일)
표시 이전 댓글
Ahmed Rashid 2015년 6월 25일
댓글: Franco Ruiz 2019년 8월 2일
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:
댓글 수: 0
Drew Davis 2015년 6월 26일
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
Find more on Simulink Support Package for Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!