matlab signal processing

The question is in the picture below, as well as the lecture needed for it. Please do it in matlab software. Thank you