How to create an example Simulink model with a MATLAB Function block that you program.
www.mathworks.com