Combined Matlab code for the combined model.