Help with matlab

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
tinch06
Posts: 2
Joined: Fri Nov 14, 2014 1:03 am

Help with matlab

Post by tinch06 »

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!

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Help with matlab

Post by jtlindgren »

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

tinch06
Posts: 2
Joined: Fri Nov 14, 2014 1:03 am

Re: Help with matlab

Post by tinch06 »

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!

Post Reply