Matlab and R functions for "Calibrating Option Pricing Models with Heuristics"