Created optim.m
Created cost.m