source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/dev/tests-mbg/operators/test_ismember.m
Last change on this file was 37, checked in by , 14 years ago | |
---|---|
File size: 387 bytes |
Line | |
---|---|
1 | function test_ismember |
2 | |
3 | x1 = [2;2]; |
4 | x2 = [2;-2]; |
5 | x3 = [-2;-2]; |
6 | x4 = [-2;2]; |
7 | x = sdpvar(2,1); |
8 | P1 = polytope(set(-0.5 < x-x1 < 0.5)); |
9 | P2 = polytope(set(-0.5 < x-x2 < 0.5)); |
10 | P3 = polytope(set(-0.5 < x-x3 < 0.5)); |
11 | P4 = polytope(set(-0.5 < x-x4 < 0.5)); |
12 | F = ismember(x,[P1 P2 P3 P4]); |
13 | sol = solvesdp(F,-sum(x)) |
14 | |
15 | mbg_asserttrue(sol.problem == 0) |
16 | mbg_asserttolequal(double(x),[2.5;2.5], 1e-4); |
Note: See TracBrowser
for help on using the repository browser.