MatlabProjectTemplate
This 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.
Features
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!
- Collaboration between multiple developers
- Building Matlab Toolboxes
- Matlab Continuous Integration and unit tests
- Distribution as both plain zip files and Matlab Toolbox
.mltbxfiles - Using ("vendoring") third-party Java JAR and Matlab libraries
- Custom Java code
- Library initialization
- Automatic library initialization
- Logging, in an SLF4M/SLF4J/Log4j-compatible manner
Requirements
Some features, including project initialization, only work on Mac and Linux. But don't worry! If you're on Windows, just install Windows Subsystem for Linux and use that.
Usage
To create a new project from this template, go on GitHub, create a new repo, and select this repo as its template.
Then:
- Add a license file!
- Edit the variables
project_settings.sh. - Run
init_project_from_template.sh. - Edit
.editorconfigto reflect your preferred code style. - Edit
<myproject>.prj.inand put in all your contact and descriptive info and other stuff.
And then:
- Put your main Matlab source code in
Mcode/. - Put your example scripts in
examples/. - Edit the files in
doc-projectto reflect your plans. - Hack away!
When you're developing code for your project, you should add the dev-kit/ directory to your Matlab path.
See MatlabProjectTemplate/README.md and other documents in the MatlabProjectTemplate/ directory for more information and details.
Unit tests
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.
License
MatlabProjectTemplate is multi-licensed under all of: MIT License, BSD 2-Clause License, Apache 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.
About MatlabProjectTemplate
MatlabProjectTemplate was written by Andrew Janke. The project home page is https://github.com/janklab/MatlabProjectTemplate. You can get support, or even contribute to the project, there.
See the FAQ or the stuff in the MatlabProjectTemplate/doc directory for more info.