Best way to organize MATLAB classes?

Posted by jjkparker on Stack Overflow See other posts from Stack Overflow or by jjkparker
Published on 2010-03-26T18:04:04Z Indexed on 2010/03/26 18:13 UTC
Read the original article Hit count: 395

Filed under:
|

MATLAB has two ways of organizing classes:

@-directories:

@ClassName\
    ClassName.m
    Method1.m
    Method2.m

Single files:

ClassName.m:
classdef ClassName
    methods
        % all methods included here
    end
end

The first style existed before the new classdef syntax, but seems to be a more structured way of doing things. The second style (everything in a single file) is new.

Which method do you use, and why?

© Stack Overflow or respective owner

Related posts about matlab

Related posts about best-practices