We are going to design a path tracking controller with switched model discretization methods in MPC frame. To address this problem, short time steps t1 are used initially to accurately model vehicle stability and longer time steps t2 are used later in the prediction horizon to efficiently extend the preview length. However, it shown " Output returned by S-function ‘MPC_11’ in ‘Controller/S-Function’ during flag=3 call must be a real vector of length 10 " when use Matlab to make a simulation.

I initially think that it is caused by the negative infinity of the prediction matrix. But I do not know how solve it.

More Qiangqiang Yao's questions See All
Similar questions and discussions