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!



