Variable with static type possible?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Daniel
am 29 Dez. 2013
Kommentiert: Walter Roberson
am 29 Dez. 2013
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 Kommentare
Akzeptierte Antwort
Wayne King
am 29 Dez. 2013
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 Kommentar
Walter Roberson
am 29 Dez. 2013
However it is still possible to assign something of a different type to the variable.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Call Java from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!