After saving the result of the first MPC you need to clear the differntialstates, control inputs, and differential equation. I will give you an example:
if the variables of the first MPC would be:
DifferentialStates x1, y1,v1;
Control a1;
DifferentialEquation f1;
you need to clear them by using the following format:
How to solve 2 mpc problems in the same file?
The output of the first one is used in the second one
Hi Joel,
After saving the result of the first MPC you need to clear the differntialstates, control inputs, and differential equation. I will give you an example:
if the variables of the first MPC would be:
DifferentialStates x1, y1,v1;
Control a1;
DifferentialEquation f1;
you need to clear them by using the following format:
Then deffine your second MPC from the begining by introducing your variables, ...
If they are in a loop, you should clear the variables of the second MPC as well at the end of loop.
Good Luck,
Hassan
hello Hassan,
how can I clear the static counter from matlab, I use 2 MPC in the same Project in Matlab
best regards