how retain value of variable in memory between calls to the function?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I am doing sorting every time when function called it should retain its value not like once function job over value of variable gets earsed.SO can you tell how to define that?Is any varible type is there or any other solution?
1 commentaire
James Tursa
le 7 Oct 2016
Please post a short example showing your code. Tell us specifically what the code is doing that you don't like, and how you would specifically like the code to behave.
Réponses (2)
Les Beckham
le 8 Oct 2016
I think what you need is to define the variable(s) that need to be retained as 'persistent' inside your function. Check the docs.
1 commentaire
Marc Jakobi
le 8 Oct 2016
I think you might want to have a look at object oriented programming in Matlab: mathworks.com/discovery/object-oriented-programming.html
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!