To be more specific, for example, I do the logical operation "[1 2 3 4 5] == 2" in Simulink, and the output is a logical array which is [0 1 0 0 0], but I need a single output as 1 in this case.
How to handle logical arrays in Simulink?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Utku
le 20 Déc 2023
Commenté : Sulaymon Eshkabilov
le 20 Déc 2023
I have a logical comparison of an array in Simulink. I need to use any() function in MATLAB to handle the output of the comparison but I realized there is not any representation of this function in Simulink library. Is using MATLAB Function block the only way to use any() or all() functions in Simulink? Is there any particular reason that these do not exist in Simulink library? How do you handle logical arrays in Simulink?
Réponse acceptée
Sulaymon Eshkabilov
le 20 Déc 2023
Yes, it can be worked around - see this plain model:
2 commentaires
Plus de réponses (2)
Sulaymon Eshkabilov
le 20 Déc 2023
Of course Simulink blocks can be used. Simulink library has a bunch of logic operation blocks - follow to see them: Simulink -> Logic and Bit Operations.
0 commentaires
Voir également
Catégories
En savoir plus sur Simulink Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!