Use MATLAB Function block to incorporate MATLAB code in a Simulink model.