Cumulative variable or += in Simulink

7 ビュー (過去 30 日間)
Mohammed Hakim
Mohammed Hakim 2020 年 5 月 8 日
コメント済み: Mohammed Hakim 2020 年 5 月 9 日
How can I do the x += 1 or x += y in Simulink?
Im not allowed to use a s-Function or M in my Project.
the cumulative sum didn`t help me.
  2 件のコメント
James Tursa
James Tursa 2020 年 5 月 9 日
We need more details of what you are working with. x += 1 is simply x = x + 1, and x +=y is simply x = x + y. So what are you trying to do specifically?
Mohammed Hakim
Mohammed Hakim 2020 年 5 月 9 日
Thank you for your attention. I know everything you explained to me.
What I am doing is translating a C ++ code to simulink and I am not allowed to use an s function. what i can't do is a cumulative variable for example (x), which increases by (y) for each round of the program and is tested in an if loop.
if ((x + = y)> 2) then do this and that

サインインしてコメントする。

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by