Hi,
I defined an objective function by a .m file as:
Objective = @(vx)loadcalkxdays3opt(x,vx,tripnumwd,tripnumwe,energycon,capacity,chargingrate,chargingeff,random,a,atemp);
When I tried to run the optimisation problem, an error occurs as:
Error using solvesdp (line 91)
Second argument (the objective function h) should be an sdpvar or logdet object (or empty).
My initial codes are:
x = sdpvar(10,1);
Constraints=[ x == 0:30:90];
Objective = @(vx)loadcalkxdays3opt(x,vx,tripnumwd,tripnumwe,energycon,capacity,chargingrate,chargingeff,random,a,atemp);
ops = sdpsettings( 'solver','Cplex');
sol = optimize(Constraints,Objective,ops);
My question is if this error is because my objective function is in m file, which is not compatible in Yalmip language?
Thank you very much for your help.
Cheers,
MY