Write Matlab Code For This Problem And Also Explain

Write Matlab Code For This Problem And Also Explain