Create fmincg

This is not my code - provided by Andrew Ng online in the Coursera class.