Variable with static type possible?
8 ビュー (過去 30 日間)
古いコメントを表示
Is it possible to declare a variable with a static type, the way it is in Java? So that I can only asign an object of the correct type to that variable?
Thank you.
0 件のコメント
採用された回答
Wayne King
2013 年 12 月 29 日
To get the equivalent of a static variable in MATLAB, use persistent. When you declare a variable to be persistent within a function, its value is retained in memory between calls to that function.
1 件のコメント
Walter Roberson
2013 年 12 月 29 日
However it is still possible to assign something of a different type to the variable.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Java Package Integration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!