Create mindistance.m