Semester 6 coursework script for MATLAB