MatLab Codes for Estimation and Inference in Some Semiparametric Models