I was generating C code for a MPC which should run on a dSPACE Scalexio RT system. I am using matlab.
I got the error using ocp_create: error setting cost_z_e, wrong dimension.
after looking into the ocp_create.c file, I saw that the dimension being compared to is ns. This seemd wrong to me, since it is cost_z_e not cost_z, etc. after changing this to ns_e, everything worked fine.
The same error ocurred for cost_zl_e and cost_zu_e , changed these as well (lines 1406 and 1421).
Did I do a mistake before with the dimensions or how is this supposed to be?