Use of any-function in simulink
18 次查看(过去 30 天)
显示 更早的评论
I want to find out wheter an input signal's value is included in an array or not.
In Matlab, I would use such code:
a = [10 20 30];
if any(x==a)
disp('a contains x');
else
disp('a doesn't contain x');
end
In Simulink, I only found this way:
But the sum block is different to the any-function and algebraic calculations with boolean values is bad coding style. How to realise the any-function in simulink?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!