I have been using MATLAB for last 5 years. So, do you have any problem in your MATLAB task? I am here to help you in completing it with the most efficient way. Since your understanding of the logic and code is more important so I will explain it by using proper comments as well as I will guide you about the other possible logics to complete the task.
In case of any help don't hesitate to contact me. 100% satisfaction is a guarantee :)