alext87
alext87

Reputation: 371

How can I separate my Matlab object's code into different files?

I'm writing a Matlab object oriented program and the program is now getting to over 1000 lines. I want to move parts of the script to other .m files for easier maintenance.

Is there a way of doing this?

Upvotes: 1

Views: 541

Answers (2)

zellus
zellus

Reputation: 9592

No question, it is as well a matter of taste whether you put methods in a class folder or one class file. Regarding clarity I opt for the one class file approach.

Classes growing that large, might be a target for refactoring. Smaller classes are easier to maintain, document and test.

Upvotes: 2

gnovice
gnovice

Reputation: 125854

You can create a class folder, then place each of the methods for the class in a separate file in this folder (instead of in one large file).

Upvotes: 3

Related Questions