matlab shortest scenario