MATLAB: Should I use system update block or RTW S-function

custom code system updatempcs-function file

I want to add a new coding after my MPC controller to do some parameter updating. So, should I use system update block or RTW S-function to implement my update coding?
Where can I find tutorial on the use of custom code system update?

Best Answer

Do you mean that you want to update the parameter value during execution? I don't think this is possible, because you are trying to use parameters as signals. See http://blogs.mathworks.com/seth/2011/03/08/how-do-i-change-a-block-parameter-based-on-the-output-of-another-block/
Related Question