MatlabProjectTemplate ("MPT") is a template repo for creating Matlab library and application projects. It defines a "standard" project structure that should be suitable for many projects, including those intended for redistribution / open source.
It is suitable for both libraries and applications, and includes coding and organizational conventions that make it safe to use this project's code in a Matlab environment that uses code from other projects, too.
MatlabProjectTemplate supports the following features. You don't have to use any of them; you can just ignore the ones you don't care about. But they're there if you need them! MPT's philosophy is "support but do not require".
.mltbx
filesJust Matlab, for most things.
Building custom Java code requires Mac or Linux plus a Java JDK and Apache Maven. If you're a Java developer, you know how to set theseup.
To create a new project from this template, go to its repo on GitHub and create a new repo by clicking the green "Use this template" button.
NOTE: Don't "fork" or "clone" the MatlabProjectTemplate repo. That will leave your project's Git repo set up wrong! Do the "Use this template" thing.
Then:
project_settings.m
.init_project_from_template.m
..editorconfig
to reflect your preferred code style.<myproject>.prj.in
and put in all your contact and descriptive info and other stuff.And then:
Mcode/
.examples/
.doc-project
to reflect your plans.When you're developing code for your project, you should add the dev-kit/
directory to your Matlab path.
See the User Guide for more information.
You should write unit tests for your project! Use the Matlab Unit Test Framework and put your tests in Mcode/+<myproject>/+test
. Run them with make test
in the shell or with dev-kit/launchtests.m
in Matlab.
MatlabProjectTemplate is multi-licensed under all of: BSD 3-Clause License, BSD 2-Clause License, Apache License, MIT License, and GPLv3. You can use it in any project with a license compatible with any of those licenses. This includes commercial and proprietary software, and contemporary postings to MathWorks File Exchange.
If you have a licensing scenario which is not covered by the above (and jeez, what are you doing that would require that?), just contact me, and I'll probably add support for it. My intention is that everybody can use MatlabProjectTemplate.
MatlabProjectTemplate was written by Andrew Janke.
You can read the online documentation on the project website and or find the code and get support at the repo on GitHub. Bug reports, feature requests, and other feedback are welcome.
See the FAQ or the stuff in the MatlabProjectTemplate/doc
directory for more info.