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.
Best Answer
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.
I would recommend that you move all creation/extraction of libpointers also inside an extrinsic function, and have only builtin (MATLAB) types at the interface, so that you can pre-define them appropriately in your top-level function.
Best Answer