Simulink elementwise switch for vector sample
이전 댓글 표시
Hi all,
my probelm:
a, b, and c all are of size [nx1]. a contains data, b is a control-vector and c the output.
I want to implement a logic into my simulink system which functions as follows:
Output should initially be zeros(length(a)). If b(1) turns to true -> c = [a(1), zeros(length(a)-1)]. So basically, for each input-element of a, there is one control-element in b. If the element-specific control-element truns true, the output of the system should become a for that specific element and remain 0 for the rest. The size of n is constant during each simulation but can be initiated differently.
Moreover, once an elemnt of c becomes a, it should remain so until the rest of the simulation even in case b turns false during that time.
I am new to simulink so this is maybe an easy question but even so I am getting a bit frustated at this point. Thank you a lot in advance!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Discontinuities에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



