how retain value of variable in memory between calls to the function?
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
James Tursa
2016 年 10 月 7 日
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.
回答 (2 件)
Les Beckham
2016 年 10 月 8 日
I think what you need is to define the variable(s) that need to be retained as 'persistent' inside your function. Check the docs.
Marc Jakobi
2016 年 10 月 8 日
I think you might want to have a look at object oriented programming in Matlab: mathworks.com/discovery/object-oriented-programming.html
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!