c=0;
constraints = [constraints, x{k+1}(2) == x{k}(2) - c{k}*u{k}(2)];
For example I define c as a constant, but in the command below it is wrongly used as a cell arry.
The error report in MATLAB is:
Simulation gestoppt
Error using manoever_init (line 829)
Error due to multiple causes.
Error in template_open_loop_manuell (line 318)
manoever_init;%(driver, params, config, road);
Error in run (line 64)
evalin('caller', [script ';']);
Caused by:
Error using manoever_init (line 829)
Cell contents reference from a non-cell array object.
Error using manoever_init (line 829)
Error in 'meCarSim/Regelsysteme/regler_library/MPC
Hybrid_YALMIP/Subsystem/MPC_YALMIP/Signal Conditioning and MPC/MPC/MPC
Controller/YALMIP' while evaluating expression.
line 829 in 'manoever_init' is the 'sim('Mymodel')', which is to run the model in Simulink.
Sometimes I need several minutes or even more to find out the error in the MPCController script. Before I used MATLAB Function (Embedded Matlab) frequently, with which the error report always includes the information of the number of the line. So I'm not sure now whether it is because of characteristics of the Interpreted MATLAB fcn or the solver.
Another stupid question: When my system is time variant (The system and the constraints are both time variant.), so I must use the MPT toolbox?
Thanks a lot!