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

10 ビュー (過去 30 日間)
Smith J
Smith J 2016 年 9 月 7 日
編集済み: Smith J 2016 年 9 月 7 日
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 ?

回答 (0 件)

カテゴリ

Help Center および File ExchangeDecision Logic についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by