# Chapter six

MATLAB resources

This section gives some helpful notes on how to use MATLAB to support learning and application of engineering knowledge linked to modelling, dynamics and control. A number of brief illustrations and notes are provided for a small number of topics and MATLAB functions. Topic relevant resources may also be referenced directly as used in the sections.

To use these files in MATLAB, save the files into your own folder and then open, for example from the command window write: 'open filename'. Videos illustrating the process and usage are in section 6.10.

- Core skills

MATLAB has tools for handling and displaying data.

A detailed section introducing the MATLAB tool and its functionality is available here. This section is for students to self-learn the basics.

A short standalone file on plotting (PDF, 621 KB).

A more recent SHORT COURSE focusing primarily on requirements for modelling and control and using live scripts is in section 6.9 below.

### 2. Solving ODEs with dsolve.m and ilaplace.m

MATLAB has a built in solver for producing the solution to simple ODEs. Two resources are provided for demonstrating how to use this tool.

Higher order ODEs video and notes for higher order ODE with dsolve (PDF, 264 KB).

Supporting m-files used in videos: file1, file2, file3, file4, file5, file6, file7

MATLAB has tools for handling Laplace transforms which thus can also be used to solve ODEs. Simple examples are given here.

Using Laplace with MATLAB: first order ODEs (PDF, 808 KB)

Using Laplace with MATLAB: second order ODEs (PDF, 314 KB)

### 3. Using MATLAB with Laplace transforms

These resources demonstrate how the MATLAB tool can be used to find inverse Laplace solutions in many alternative forms.

### 4. MATLAB tools for basic feedback analysis

Resources covering the basic MATLAB commands for the analysis of simple feedback systems.

Section 3.6 has slower and detailed illustrations of the basic MATLAB commands for feedback alongside video demonstrations.

Section 6.9 also covers all the MATLAB basic tools for system analysis, but is based around livescript files and covers more extensive usage and examples.

Summary of MATLAB commands for feedback (PDF, 522 KB)

Tutorial sheet (PDF, 405 KB)

Handling polynomials (PDF, 900 KB)

### 5. MATLAB for discrete systems analysis

Avoids the need to do lots of tedious number crunching by hand.

Simple illustrations (PDF, 740 KB)

Covers the traditional tools of root-loci, frequency response, Bode and Nyquist. Also has a number of resources on the use of sisotool.

### 7. MATLAB GUIs focussed mainly on system behaviour with simple feedback

A number of interactive GUIs for users to investigate open/closed-loop behaviours across a range of case studies. Users should note that MATLAB is fazing out GUIs since 2018 and now favouring APPS (see section 6.8), although for now the GUIs still work.

Zip file containing GUIs and supporting explanations of context and usage (ZIP, 5.8 MB).

Just the mfile is needed to run the GUI, mostly the filenames end with '_export.m'.

Recently MATLAB moved GUIs to a new app format. Follow the link for more detail on the available files and their use.

Live scripts allow the author to combine notes and explanation with MATLAB code to make it easier for the user to exploit MATLAB tools. A number of live scripts have been created to support an introductory control course. Follow the link for more details and to download the files.

This section provides video illustrations of how to use the interactive MATLAB files associated to the first course. The hope is that providing short video illustrations will mean users unfamiliar with MATLAB will very quickly gain confidence in how to use these files and require a minimum of coding competence.

In conjunction with sponsorship from Mathworks, Dr. Rossiter and peers have been constructing a toolbox of interactive files users to become familiar with control concepts and develop their understanding. More details in this link.

Simulink is a powerful tool within the MATLAB suite for modelling and simulating system behaviour, especially where the interconnections are complicated and/or there are non-linear components. Being a visual environment, it is straightforward to see how different components relate to each other and thus to construct models representing complex systems.