added matlab demo for exercise 6