Part III: Introduction to programming with Matlab (Chapters 5, 6)
Section outline
-
So far we have seen how to use MATLAB to perform commands or to evaluate expressions by writing them in the command line (After the >> prompt), therefore the commands used are generally written as a single instruction (possibly on a single line). However, there are problems whose solution description requires several instructions, which requires the use of several lines.
For example, searching for the roots of a quadratic equation (taking into account all possible cases). A collection of well-structured instructions aimed at solving a given problem is called a program. In this part of the course, we will present the mechanisms for writing and executing programs in MATLAB.
