Static variables in MATLAB
157 ビュー (過去 30 日間)
古いコメントを表示
How do I declare static variable in MATLAB?
0 件のコメント
採用された回答
Abhishek Jain
2016 年 10 月 6 日
編集済み: madhan ravi
2018 年 11 月 11 日
Use keyword persistent to declare static variables
persistent x;
0 件のコメント
その他の回答 (1 件)
Adam
2016 年 10 月 6 日
You can use persistent variables if that is what you mean, but only use them if you really need to. Similar to global variables they are far easier to introduce bugs into your workspace with then simply passing variables around between functions or using a class to define the scope of a variable.
1 件のコメント
Ravi Singh
2020 年 4 月 23 日
Hi Adam ,
I need to assign a static variable in one method call and use the same variable in another method call is there any way to do so ?
参考
カテゴリ
Help Center および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!