8. MATLAB Basics#

Jack Little

Fig. 8.1 Jack Little#

Cleve Moler

Fig. 8.2 Cleve Moler#

MATLAB, short for “MATrix LABoratory”, is a high-level programming language and interactive environment developed by Jack Little and Cleve Moler who later formed MathWorks. It is widely used in engineering, mathematics, and scientific research for numerical computation, data analysis, visualization, and algorithm development. Whilst Python will be the primary language that you will use during your course, some units that concentrate on numerical methods will make use of MATLAB.

8.1. MATLAB#

MATLAB comes with its own self contained IDE. Run the MATLAB application and you should see a window similar to the one below.

MATLAB application

The layout of the MATLAB window is similar to that of the Spyder window (this isn’t a coincidence and Spyder has been developed to emulate MATLAB). In the centre we have a Command Window which is where we can enter single line MATLAB commands (similar to the Python console), on the right we have Workspace which contains information about the variables that are currently stored in the memory and on the left we have Current Folder which shows the files contained in the folder which we are in. You may be wondering where the editor is, don’t worry this will appear when we create a MATLAB file.

Note

If you have reached already worked through the Python section of these materials you will notice that the MATLAB section is very similar and uses most of the same explanations, examples and exercises. Once you know the fundamentals of programming in one language, moving to another language is much easier and you will find yourself working through this section quicker than you did for the Python section.