Rev | Line | |
---|
[37] | 1 | function sys=relaxdouble(X) |
---|
| 2 | %RELAXDOUBLE Return numerial value treating nonlinear variables as independent |
---|
| 3 | |
---|
| 4 | % Author Johan Löfberg |
---|
| 5 | % $Id: relaxdouble.m,v 1.5 2006/07/26 20:17:58 joloef Exp $ |
---|
| 6 | |
---|
| 7 | solution = yalmip('getsolution'); |
---|
| 8 | lmi_variables = X.lmi_variables; |
---|
| 9 | opt_variables = solution.variables; |
---|
| 10 | |
---|
| 11 | values = zeros(1+length(lmi_variables),1); |
---|
| 12 | values(1)=1; |
---|
| 13 | for i=1:length(lmi_variables) |
---|
| 14 | opt_index = find(lmi_variables(i)==opt_variables); |
---|
| 15 | if isempty(opt_index) |
---|
| 16 | values(i+1,1)=NaN; |
---|
| 17 | else |
---|
| 18 | values(i+1,1)=solution.optvar(opt_index); |
---|
| 19 | end |
---|
| 20 | end |
---|
| 21 | |
---|
| 22 | sys = X.basis*values; |
---|
| 23 | sys = full(reshape(sys,X.dim(1),X.dim(2))); |
---|
Note: See
TracBrowser
for help on using the repository browser.