matlab用yamlip工具箱调用cplex求解报错,如何解决?

具体是下面的报错
警告:** One of the constraints evaluates to a DOUBLE variable **

In lmi/horzcat (line 16)
In test2 (line 55)
警告: **One of the constraints evaluates to a DOUBLE variable **
In lmi/horzcat (line 16)
In test2 (line 56)
错误使用 lmi/horzcat (line 21)
One of the constraints evaluates to a FALSE LOGICAL variable

img

yalmip环境中变量是无法比较大小的,只能用约束的形式写出:
Constraints=[];
Constraints=[Constraints, ];

代码不全,只能大概给个链接你看下

解决方法
第一个问题警告,
参考下面两个方式解决
参考:


https://groups.google.com/g/yalmip/c/eND4PFewN6c

第二个问题报错
问题
你已经被 MATLAB 中的这个“设计功能”击中了
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Extra.NANInModel

解决方法:
因此,改为使用串联来定义 Acl。

至于在for循环中使用Acl

Acl = 0;
for i=2:N
   r(i)=1;
   Q=1/N*toeplitz(c0,r);
   Acl=[Acl x0'*Q*x0+x0'*(Q+Q')*(x-x0)];
   r=r0;
end

看下这个讨论是否对你有所帮助