Problems when solving a stochastic MPC problem on MATLAB

Hello. Before explaining my issue, I want to clarify that I am not from the control field but from the architecture field, so I am not familiar with some mathematical concepts.

Still, I want to implement a stochastic MPC in Simulink. I have found that the final form of the objective function for this stochastic MPC is as follows, where M is the lower triangular matrix to be optimized.





image

image
image
image

Although the official examples provide many MATLAB and Simulink implementations for optimization control, due to the lack of detailed documentation on the interfaces of functions or classes in ACADOS, I still cannot solve this MPC problem on my own after reviewing the examples. Could you provide some direct guidance? My main confusion lies in how to write this objective function in MATLAB. Thank you.