source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/usertest/sdedemo.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.3 KB
Line 
1function sdedemo;
2%sdeDemo tests SDE with a simple spiral consisting of 100 points.
3%please accustom the code to your SDP solver (CSDP/SEDUMI)
4%
5%function sdeDemo;
6%
7%tt=linspace(0,4*pi,100);
8%X=[tt.*sin(tt);tt.*cos(tt)];
9%figure;
10%subplot(2,1,1);
11%scatter(X(1,:),X(2,:),'o',tt,'filled'); axis equal;
12%title('Original');
13%drawnow;
14%try
15% [Y,D]=sdeCSDP(X);       % CSDP
16% fprintf('Seems like sdeCSDP is working!\n');
17%catch
18%  [Y,D]=sdeNT(X);           % SEDUMI
19%  fprintf('Seems like sdeSeDuMi is working!\n');
20%end;
21%subplot(2,1,2);
22%scatter(Y(1,:),Y(2,:),'o',tt,'filled'); axis equal
23%title('Reduced Dimensionality');
24
25tt=linspace(0,4*pi,100);
26X=[tt.*sin(tt);tt.*cos(tt)];
27%X=X-repmat(mean(X,2),1,length(X));
28figure;
29pars.slack=1;
30
31try
32 fprintf('Computing distances...');
33 Dis=distance(X); 
34 fprintf('done\n');
35catch
36 error('ERROR! Are you sure distance.m is in the path?');
37 
38end;
39
40subplot(2,1,1);
41scatter(X(1,:),X(2,:),60,tt,'filled'); axis equal;
42title('Original');
43drawnow;
44try
45 pars.solver=0;
46 [Y,D]=sde(Dis,3,pars);       % CSDP
47 fprintf('\n\nCSDP is working!\n');
48catch
49  pars.solver=1;
50  [Y,D]=sde(Dis,3,pars);           % SEDUMI
51  fprintf('\n\nCSDP does not seem to be installed correctly.\n');
52  fprintf('SeDuMi is working!\n');
53end;
54subplot(2,1,2);
55scatter(Y(1,:),Y(2,:),60,tt,'filled'); axis equal;
56title('Reduced Dimensionality');
Note: See TracBrowser for help on using the repository browser.