Use of any-function in simulink

17 ビュー (過去 30 日間)
Andreas
Andreas 2016 年 12 月 2 日
回答済み: Andreas 2016 年 12 月 2 日
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?

採用された回答

Andreas
Andreas 2016 年 12 月 2 日
Easy answer: The OR-Block is exactly what I need.
I wrote too many .m-Scripts.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by