Matlab project | Computer Science homework help

I have a MatLab project I provided the entire project I only need Exercise 6 done (not the entire project). I highlighted the section that needs to be done as well. Please look over the entire project to see how exercise 6 fit in with the entire project. This project is due project on Sep 27.