Just represent or code it in MATLAB function format or function file. In the next step open MATLAB Simulink library and link your function to toolbox. Now you can use your input data for execution your function files.
Alternatively, you compute it via m-files formats. Before doing this job you will need to spend a few day in reading and understanding optimization tool box.
You can implement your control law and dynamic model in MATLAB/Simulink using different methods, the simplest is using the discrete tool box and commonly used blocks. However, the fastest method is to use s-function and write your equation in C-code.
You need to make sure to change the mathematical solver to be the same as the method you used to transfer your function from continuous to discrete time domain.