Variable with static type possible?
조회 수: 13 (최근 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!