Hello! I'm from Argentina. Excuse my english
I'm starting to work with matlab scripting and with the tutorials, but y can't to iniatilize variables.
I'm trying to plot a dot every time I call function "process" to show de "history" of the signal in the time. But if a write count = 0; (for example) the function initialize to zero every time. And if I don't write count = 0; the instruction count = count +1; doesn´t work.
I don't find the way to update the plot every time that xxxxx_process is called.
Sorry if this has already been discussed.
Thanks!
Help with matlab
-
- Posts: 775
- Joined: Tue Dec 04, 2012 3:53 pm
- Location: INRIA Rennes, FRANCE
Re: Help with matlab
Hi Tinch, welcome aboard.
You can try declaring count as a global variable, either before the function declarations, or possibly like this,
http://www.mathworks.com/help/matlab/ref/global.html
Normal variables defined inside functions only persist for the duration of the function.
Good luck,
Jussi
You can try declaring count as a global variable, either before the function declarations, or possibly like this,
http://www.mathworks.com/help/matlab/ref/global.html
Normal variables defined inside functions only persist for the duration of the function.
Good luck,
Jussi
Re: Help with matlab
jtlindgren wrote:Hi Tinch, welcome aboard.
You can try declaring count as a global variable, either before the function declarations, or possibly like this,
http://www.mathworks.com/help/matlab/ref/global.html
Normal variables defined inside functions only persist for the duration of the function.
Good luck,
Jussi
I didn't know about global variables.
I resolved my problem!
Thank you!