06-27-2012 02:44 AM - edited 06-27-2012 02:45 AM
I would like to see the behaviour of some variables and counters inside my MCode Block. So what i did, I put these signals or variables as Inputs of my MCode Block after the simulation the following errors happen:
Error("control_module.m"): line 4:12 The persistent declaration must precede any use of the variable samples_counter. Error("control_module.m"): line 5:12 The persistent declaration must precede any use of the variable signals_counter.
Any suggestions are welcome
Thanks in advance
06-28-2012 12:37 AM
as the error message said, you can't use some variable name before the persistent declaration, and the function parameter list is such a forbidden use.
I think you should use the debbugging methods offered by Matlab.
(Actually I have no experience with that)
Alternatively, you could use some other names in the parameter list, and then assign the persistent variables to these names in the code. (Q&D-Solution)
Have a nice simulation