Create calibrate.m

Added the first version of the calibration code.