MATLAB Programming Style Guidelines
Editor's Note: This file was a File Exchange Pick of the Week
Advice on writing MATLAB code usually addresses efficiency concerns, with recommendations such as "Don't use loops." This document is different. Its concerns are correctness, clarity and generality. The goal of these guidelines is to help produce code that is more likely to be correct, understandable, sharable and maintainable.
This document lists MATLAB coding recommendations consistent with best practices in the software development community. These guidelines are generally the same as those for C, C++ and Java, with modifications for MATLAB features and history. The recommendations are based on guidelines for other languages collected from a number of sources and on personal experience.
This file is also available at http://www.datatool.com/prod02.htm
Cite As
Richard Johnson (2024). MATLAB Programming Style Guidelines (https://www.mathworks.com/matlabcentral/fileexchange/2529-matlab-programming-style-guidelines), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: MATLAB Coding Checklist, MATLAB Style Guide Wiki access and search function, Matlab Style Guidelines Cheat Sheet, MATLAB Style Guidelines 2.0
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |