Best way to organize MATLAB classes?
- by jjkparker
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?