Create costFunction.m