Exercise 3 and matlab exercise 2 done.