MATLAB does not support static member variables (static properties in MATLAB terminology) unless they are constant. And afact, there is no way of overloading "MyClass.my_class_variable".

Are there any opinions on the preferred syntax for wrapping them?

Options for wrapping a variable named "foo":
1. Adding a get/set prefix and make static method: "MyClass.set_foo(v)" and "v = MyClass.get_foo()"
2. Same, but without any prefix (checking the number of arguments): "MyClass.foo(v)" and "v = MyClass.foo()"
3. Prefix only for set method: "MyClass.set_foo(v)" and "v = MyClass.foo()"
4. Something else?

I don't have any static member variables in the public API of the C++ code I write, so I do not really have any opinion.

Best regards.

P.S. Non-static member variables work just fine and have already been implemented, i.e. "a = my_instance.foo;" and "my_instance.foo = a;" where "my_instance" is an instance of MyClass.


Joel Andersson
Ptge. Busquets 11-13, atico 3
E-08940 Cornella de Llobregat, Spain
Home: +34-93-6034011
Mobile: +32-486-672874 (Belgium) / +34-63-4408800 (Spain) / +46-707-360512 (Sweden)