Intro to MATLAB Programming

In this chapter, you will familiarise yourself with the basics of programming i.e. Control-Flow, Custom Functions and Debugging, both abstractly and in MATLAB.

We start this section with an abstract introduction into the Fundamentals of Programming. You will learn about the basic tools for control flow such as conditions and loops. The initial treatment of this is abstract and written in pseudo-code.

Programming Fundamentals

After this, we will dive into the basics of Control Flow in MATLAB, building on the logical operators you have already learned in the 'Getting Started' section. Flow control allows us to write more complex programs by dividing the code into code blocks which are only executed when certain conditions are met or executing code block multiple times with different parameters i.e. creating loops.

ConditionsLoops

Next, we will discuss how to write custom functions that allow us to execute code blocks in a dynamic way depending on the inputs to avoid repetitions (DRY principle) and provide abstraction.

Custom Functions

We conclude with a very brief overview of Debugging in MATLAB.

Debugging

Last updated