---
description: >-
  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.
---

# Intro to MATLAB Programming

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.

{% content-ref url="programming-fundamentals" %}
[programming-fundamentals](programming-fundamentals)
{% endcontent-ref %}

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.

{% content-ref url="conditions" %}
[conditions](conditions)
{% endcontent-ref %}

{% content-ref url="loops" %}
[loops](loops)
{% endcontent-ref %}

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.

{% content-ref url="custom-functions" %}
[custom-functions](custom-functions)
{% endcontent-ref %}

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

{% content-ref url="debugging" %}
[debugging](debugging)
{% endcontent-ref %}
