# 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](https://coding-courses.gitbook.io/matlab/matlab-programming/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](https://coding-courses.gitbook.io/matlab/matlab-programming/conditions)
{% endcontent-ref %}

{% content-ref url="loops" %}
[loops](https://coding-courses.gitbook.io/matlab/matlab-programming/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](https://coding-courses.gitbook.io/matlab/matlab-programming/custom-functions)
{% endcontent-ref %}

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

{% content-ref url="debugging" %}
[debugging](https://coding-courses.gitbook.io/matlab/matlab-programming/debugging)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coding-courses.gitbook.io/matlab/matlab-programming/intro-to-matlab-programming.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
