tags:

views:

172

answers:

3

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
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
for the public/private data thing, see the video at 3:35
catchmeifyoutry
... 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
Ah, that video was just what I needed! Thanks.
rlbond
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
+1  A: 

I made this video about this a long time ago:

http://blogs.mathworks.com/videos/2008/07/07/advanced-matlab-class-system-for-oop-in-matlab-introduction/

MatlabDoug
This was a good video, but not as in-depth as I had hoped.
rlbond