Hi Johan,
I have an issue and hence a doubt.
I define a set of sdpvar matrices as follows:
Ac_pred = sdpvar(repmat(6,Hp),repmat(6,Hp));
So I want to create Hp matrices of 6 by 6 size and pass them to the optimizer object but this returns:
The parameters must be SDPVAR objects. Parameter #5 is a CELL
I understand that if I use that definition I obtain a cell of sdpvar matrices, but how can I obtain a sdpvar of sdpvar matrices?
I have been seeing many examples but all of them are very much simple.
Thank you so much.
Answer:
AC_pred is a cell of SDPVARs, which is precisely what optimizer wants when you have more than 1 parameter, so I don't see where you have problems. If you placed Ac_pred in a cell, you have to do parameters = {otherparameters, AC_pred{:}} so that it is a cell of sdpvars. For further assistance, please use the YALMIP Google groups support forum.
Thank you. Until here I agree with you. But, when you built the input dell to be passed to the controller object inside the simulation loop then you have to pass each one of the matrices one by one like this:
inputs = { Ac_pred(:,:,1), Ac_pred(:,:,2), Ac_pred(:,:,3), Ac_pred(:,:,4),...
Ac_pred(:,:,5), Ac_pred(:,:,6), Ac_pred(:,:,7), Ac_pred(:,:,8),...
Ac_pred(:,:,9), Ac_pred(:,:,10), Ac_pred(:,:,11), Ac_pred(:,:,12)};
[solutions,diagnostics] = controller{inputs};
If not, the optimizer detects that you are trying to introduce a cell that contains a cell of matrices and the optimizer function does not like this.