I'm having a lot of trouble trying to figure out how to use classes in MATLAB. I'm very familiar with C++ and Python but I just can't figure anything out about how to define classes in MATLAB. Does anyone know a very good resource with lots of examples? The official documentation leaves much to be desired.
+2
A:
The mathwork site does have some OOP examples, could you indicate more precisely what you are looking for?
However, note that older Matlab versions had a different OOP syntax, the classdef
keyword was added in 2008a (see video).
catchmeifyoutry
2010-05-20 23:31:51
Those examples don't actually show the entire class file, first of all. Second, I don't know how to have public vs. private data. And inheritance and polymorphism is still a mystery.
rlbond
2010-05-20 23:53:29
for the public/private data thing, see the video at 3:35
catchmeifyoutry
2010-05-20 23:57:27
... and see 6:42 in the video for inheritance. Still, I'd also be interested in more tutorials see I'll keep an eye on any other answers too ;)
catchmeifyoutry
2010-05-21 00:01:37
Ah, that video was just what I needed! Thanks.
rlbond
2010-05-23 20:36:14
A:
Not a tutorial as such, but the Matlab xunit toolbox by MathWorks' Steve Eddins uses (new style) OOP, which might be useful to see how things work.
Richie Cotton
2010-05-21 13:03:22