To be frank the question is very unclear. Are you having trouble with the topic or to implement it as Matlab Code ?
Even by assuming that you know the topic since the forum is for Matlab related queries, there is so little one can do to help you here since the problem require knowledge in both the topic and Matlab.
I suggest you reach out to your classmates in this regard. It would be a comfortable solution for this.