Welcome to the Online Scientific Computing MATLAB course. This course aims to give students a good understanding of the MATLAB programming language, and the use of MATLAB in data analysis, image analysis, numerical calculus, linear algebra and the solution of ODEs. Where applicable, a revision of elements of A-level mathematics needed for these areas is provided. Elements of software engineering are covered to give students the ability to write well-structured code, as well as how to use MATLAB to present their work using movies or Graphical User Interfaces (GUIs).
The course runs from 08 May 2023 to 19 June 2023 and is supported via an MS Teams Team, which you will have already been added to. The course leader, John Brittain, will be available to help you with the course content and general MATLAB enquiries, and will respond to messages on the MS Teams Team throughout the course on a first come first served basis.
If you have any questions then contact the course tutor via the MS Teams Team.
The course is broken down into a number of units, each one is designed to take approximately one day to complete, however this will depend greatly on your background.
The first unit is much shorter and gives you an introduction to the course. You should look at this now to make sure that you have everything you need to begin the course.
The remainder of the course is split into two sections: compulsory units, which contain general concepts of MATLAB and A-level mathematics; and optional units, which are units that will require some detailed mathematical knowledge.
You should work through the units in your own time. Click on the links below to view the units.
In order to complete the course you should complete the following 3 units and submit the associated assessments given below.
These units are optional and are intended for students with a background in the physical sciences. However, background material is given where needed, so the units should also be accessible to non specialists.
If you would like advice on which optional units to take then contact the course leader via the MS Teams Team.
Write a MATLAB function which calculates the mean and median of a set of numbers.
mean
or median
.sort
useful.[mean_x, median_x] = MeanMedian(x);
mean_x
and median_x
: check this with the command whos
.x=[1 2 3 1 2 3 3 3]
where you should get mean_x=2.25
and median_x=2.5
.x=[5 2 -4]
where you should get mean_x=1
and median_x=2
.You should submit the .m file created for this assessment.
The file data.txt (right click to save to your computer) contains some data in the form:
x1 y1
x2 y2
x3 y3
...
Write a MATLAB script that:
xi yi
. (You may find the command polyfit
useful.)xi
. (You might find the command polyval
useful.)datafit.txt
with two columns xi zi
where zi
is the value of the fitted polynomial at the points xi
).
You will use this file in the next assessment.
You might find the command “save('datafit.txt', 'datafit', '-ASCII')
” useful..png
file.Note that all these steps should be done automatically in the script. You should submit the script and the resulting .png file for this assessment.
Write a MATLAB script to:
datafit.txt
).For this assessment you should submit the script, the value of the maximum and minimum rate of change (together with where they occur) and the area under the curve.
There are no assessments required for the optional units. However, support for the exercises will still be provided via the MS Teams Team. If you finish the compulsory units and would like support on your own project during the course then you can feel free to contact the course leader.
Each student will have a private channel on the MS Teams Team for one-to-one contact with the course leader. All files for assessment should be added to the conversation on that private channel by the final day of the course at the latest.
You will need to have submitted the required material for all three compulsory assessments before the course ends in order to complete the course. You can submit the assessments whenever you like throughout the course, however, and you are encouraged to submit the assessments as soon as you have completed them, so that you can receive feedback as you go through the course.