Chapter 4

Programming Tutorial

Principles and Best Practices

Pascal Wallisch

Abstract

Unlike many other sections in MATLAB® for Neuroscientists, the focus here is not on learning techniques in MATLAB, but on how to use those techniques better. The sections that follow introduce guidelines for code organization in small and large projects, defect (bug) control, and testing strategies in an attempt to communicate strategies for managing the complexity that comes with larger programming efforts.

Keywords

code organization; code maintenance; variables; global functions; mnemonics; scope; parameters; commenting code; objects

4.1 Goals of this Chapter

Unlike most other sections in MATLAB® for Neuroscientists, the focus here is not on learning new techniques ...

Get MATLAB for Neuroscientists, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.