Viewing explicit constraints

40 views
Skip to first unread message

Stephanie

unread,
Oct 24, 2013, 1:54:43 PM10/24/13
to yal...@googlegroups.com
Hi,

Say I run code that says:

x = sdpvar(1,1);
y = sdpvar(1,1);
constr = [ x <= 0 ];
constr = [constr, y >= 1];

For debugging purposes, how can I view the individual constraints that the variable constr holds?

Thanks!

Johan Löfberg

unread,
Oct 24, 2013, 2:00:02 PM10/24/13
to yal...@googlegroups.com
Typically not possible as YALMIP actually doesn't know what the involved variables are called. To YALMIP, every variable is simply defined by an index. However, for simple cases, this works (as in your case)

sdisplay(sdpvar(constr(2)))
-1+y

I.e., -1+y is non-negative.

Most often you will not get this nice display, and it will show -1+internal(2) instead (2 being the internal index to y)

Reply all
Reply to author
Forward
0 new messages