How to define a persistent array in an Embedded function
Afficher commentaires plus anciens
I want to define some persistent arrays in an embedded function,and change their walues in cycles,but I don't know how to define this. I had trid this:
persistent X;
if isempty(X)
X=0;
end
but obviously,it's wrong. Please help me,thanks
3 commentaires
Kaustubha Govind
le 29 Oct 2012
How about:
persistent X;
if isempty(X)
X=zeros(1,5);
end
honglin
le 30 Oct 2012
Kaustubha Govind
le 31 Oct 2012
Glad it helped! I added an answer with that code - could you please accept it if is resolves the question?
Réponses (1)
Kaustubha Govind
le 31 Oct 2012
How about:
persistent X;
if isempty(X)
X=zeros(1,5);
end
Catégories
En savoir plus sur Simulink Functions dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!