embedded matlab function

I'm using embedded matlab function for my project. How to initialize the parameter just once at the beginning? some sort like this: j = 0 (initialize once only) j=j+1 (the value of j is updated after every loop running)

Respuestas (1)

Rick Rosson
Rick Rosson el 22 de Dic. de 2011

1 voto

Please try:
persistent j
if isempty(j)
j = 0;
end
j = j + 1;
HTH.
Rick

Categorías

Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.

Preguntada:

el 22 de Dic. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by