for example, for any declared variable "U" U = U+5; U = U*a;
I found that after a variable is calculated by a block, its output always become another variable. such as C = U+5; B = U*a;
Thanks
Tehsin
If I understand correctly, you want use U as a global variable. Is it correct?
Hi SACHIN: Thanks for your reply.
Yes, I want "U" as an global variable. But the global variable is always replaced by an local after I use Simulink Coder to generate C code.
So, how do I use simulink to create a global that equal to the C syntax as "U++;" or ''U=U*5;"
ex: simulink: (in_global)--->[*5]--->(out_local)
simulink Coder: int out_local; out_local = in_global * 5;
How to create the code as "in_global = in_global * 5;"
Thank you
2 Comments
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/50269#comment_103980
what do you mean? It's obvious, after U=U+5, U will change
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/50269#comment_104037