在 matlab 中使用 YALMIN 的机会约束

问题描述 投票:0回答:0

FOR 时间段 t 其中 t:0 到 51 我有约束 q(t)=0 如果 a(t)=0 ,如果 a(t)=1 则 q(t)=22,如果 a(t)=2,q(t)= 则 q(t)=32 45 如果 a(t)=3

我尝试在 matlab 中使用 YALMIN 我给了

q=[0,22,32,45]
a = sdpvar(T, 1);
out=q(a(t)+1)
but got error  : Unable to use a value of type sdpvar as an index.

我可以做出什么改变?

matlab optimization constraints
© www.soinside.com 2019 - 2024. All rights reserved.