Adding element-wise constraint on each vector entry

11 views
Skip to first unread message

Jack1

unread,
Jul 24, 2019, 11:46:05 AM7/24/19
to YALMIP
I have three vectors a, b, c of the same dimension. 
I would like to constrain each element-wise difference: |a_i - b_i| < c_i
I was wondering how could I do so in a for loop in Yalmip easily? thank you. 

Johan Löfberg

unread,
Jul 24, 2019, 11:57:39 AM7/24/19
to YALMIP
abs(a-b)<=c or more efficiently norm(a-b,inf) <= c or manually -c<=a-b<=c

Johan Löfberg

unread,
Jul 24, 2019, 11:58:04 AM7/24/19
to YALMIP
i.e no reason to use a for-loop
Reply all
Reply to author
Forward
0 new messages