How to sum array elements in a for loop in Stateflow C action language

10 vues (au cours des 30 derniers jours)
Smith J
Smith J le 7 Sep 2016
Modifié(e) : Smith J le 7 Sep 2016
I tried everything I could think of, it seems the Stateflow C action language does not recognize "for" loop, the only way I can make it work is :
entry: sum = a[0] + a[1] + a[2] + a[3];
avg = sum / count;
But what if I don't know count ahead of time, what do I do ?

Réponses (0)

Catégories

En savoir plus sur Decision Logic dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by