Added function for computing the closed form solution, and added plotting functionality to the matlab script.