MatLab code for CE3002 CE3007