Create Q6

This is the solution to question 6 homework 2 using matlab for the Learning from data Machine learning course.