When I run MPC_F8 I get this error. Seems like there are some array-wise issues with the code.
`Warning: Directory already exists.
In MPC_F8 (line 9)
Warning: Directory already exists.
In MPC_F8 (line 10)
Simulation started. It might take a while...
Unable to perform assignment because the left and right sides have a different number of elements.
Error in ConstraintFCN (line 39)
cy(2*ct-1) = -xk1(1)+zMin;
Error in MPC_F8>@(u)ConstraintFCN(u,uHistory(:,ct),xhat,Ts,N,LBo,UBo,LBdu,UBdu,[]) (line 52)
CONSFUN = @(u) ConstraintFCN(u,uHistory(:,ct),xhat,Ts,N,LBo,UBo,LBdu,UBdu,[]);
Error in fmincon (line 655)
[ctmp,ceqtmp] = feval(confcn{3},X,varargin{:});
Error in MPC_F8 (line 53)
uopt = fmincon(COSTFUN,uopt,[],[],[],[],LB,UB,CONSFUN,options);
Caused by:
Failure in initial nonlinear constraint function evaluation. FMINCON cannot continue.`
When I run MPC_F8 I get this error. Seems like there are some array-wise issues with the code.
`Warning: Directory already exists.
Error in ConstraintFCN (line 39) cy(2*ct-1) = -xk1(1)+zMin;
Error in MPC_F8>@(u)ConstraintFCN(u,uHistory(:,ct),xhat,Ts,N,LBo,UBo,LBdu,UBdu,[]) (line 52) CONSFUN = @(u) ConstraintFCN(u,uHistory(:,ct),xhat,Ts,N,LBo,UBo,LBdu,UBdu,[]);
Error in fmincon (line 655) [ctmp,ceqtmp] = feval(confcn{3},X,varargin{:});
Error in MPC_F8 (line 53) uopt = fmincon(COSTFUN,uopt,[],[],[],[],LB,UB,CONSFUN,options);
Caused by: Failure in initial nonlinear constraint function evaluation. FMINCON cannot continue.`