Guidelines for writing clean and fast code in MATLAB

This document gives hints on how to write fast and good quality MATLAB code.
17,2K téléchargements
Mise à jour 5 nov. 2015

Afficher la licence

Note de l’éditeur : This file was selected as MATLAB Central Pick of the Week

This document is aimed at all MATLAB users who are already familiar with the syntax but may not yet know the each and every pitfall of MATLAB programming. Its goal is to give a number of hints which enable the reader to write quality MATLAB programs and to avoid commonly made mistakes.
There are three major independent chapters which may very well be read separately. Also, the individual chapters each split up into one or two handful of chunks of information. In that sense, this document is really a slightly extended list of dos and don’ts.
This guide is written as part of a basic course in numerical analysis, most examples and codes will hence tend to refer to numerical integration or differential equations. However, almost all aspects are of general nature and will also be of interest to anyone using MATLAB.
Feel free to contribute at

Citation pour cette source

Nico Schlömer (2024). Guidelines for writing clean and fast code in MATLAB (, MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2009a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
En savoir plus sur Logical dans Help Center et MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version

small style updates

typos, small updates

* added section on Python
* fixed some typos

typo in description

- changed colors
- added paragraph on logical indexing
- updated license