color vector using in plotting example points and lines between corresponding vertices
2016-10-27 02:50
417 查看
numvert1 = size(landmark1, 1); numvert2 = size(landmark2, 1); colorvector1 = (1:numvert1)'/ numvert1; colorvector2 = (1:numvert2)'/ numvert2; scatter3(vertex1(landmark1,1),vertex1(landmark1,2),vertex1(landmark1,3),50,colorvector1,'filled'); scatter3(vertex2(landmark2,1),vertex2(landmark2,2),vertex2(landmark2,3),50,colorvector2,'filled'); colormap jet(256);
for k = sol
i = mod(k-1,n1) + 1;
j = floor((k-1)/n1) + 1;
XYZ = [XYZ; vertex1(landmark1(i),:) vertex2(landmark2(j),:)];
end
color = jet(length(sol));
for i = 1:size(XYZ,1)
p(i) = plot3(XYZ(i,[1 4]), XYZ(i,[2 5]), XYZ(i,[3 6]));
set(p(i),'Color',color(i,:));
end
num = size(IDX2, 1);
colorvector = (1:num)'/ num;
hold on
if exist('h1')~=0
delete(h1);
h1 = scatter3(v4(IDX2,1),v4(IDX2,2),v4(IDX2,3),20,colorvector);
else
h1 = scatter3(v4(IDX2,1),v4(IDX2,2),v4(IDX2,3),20,colorvector);
end
if exist('h2')~=0
delete(h2);
h2 = scatter3(Target_vertex(IDX(IDX2),1),Target_vertex(IDX(IDX2),2),Target_vertex(IDX(IDX2),3),20,colorvector,'filled');
else
h2 = scatter3(Target_vertex(IDX(IDX2),1),Target_vertex(IDX(IDX2),2),Target_vertex(IDX(IDX2),3),20,colorvector,'filled');
end
colormap jet(256);
XYZ = [];
XYZ = cat(2, v4(IDX2,:), Target_vertex(IDX(IDX2),:));
color = jet(length(IDX2));
for i = 1:size(XYZ,1)
p(i) = plot3(XYZ(i,[1 4]), XYZ(i,[2 5]), XYZ(i,[3 6]));
set(p(i),'Color',color(i,:));
end
hold off
20/03/2018 更新
debug = 1;
if debug
num = size(IDX_TARGET, 1);
colorvector = (1:num)'/ num;
hold on
if exist('h11')~=0
delete(h11);
end
h11 = scatter3(P(IDX_TEMPLATE,1),P(IDX_TEMPLATE,2),P(IDX_TEMPLATE,3),20,colorvector);
if exist('h22')~=0
delete(h22);
end
h22 = scatter3(Q(IDX_TARGET,1),Q(IDX_TARGET,2),Q(IDX_TARGET,3),20,colorvector,'filled');
colormap jet(256);
XYZ = zeros(size(IDX_TARGET,1), 6);
for k = 1:size(IDX_TARGET,1)
XYZ(k,:) = [ P(IDX_TEMPLATE(k),:) Q(IDX_TARGET(k),:)];
end
color = jet(size(IDX_TARGET,1));
for i = 1:size(XYZ,1)
pp(i) = plot3(XYZ(i,[1 4]), XYZ(i,[2 5]), XYZ(i,[3 6]));
set(pp(i),'Color',color(i,:));
end
delete(pp);
delete(h11);
delete(h22);
end
相关文章推荐
- Matrix and linear algebra in F#, Part IV: profile your program, find the bottleneck and speed it up: using matrix multiplication as an example[z]
- Difference between throw and throws in Exception handling - Java Example
- Example: Communication between Activity and Service using Messaging
- In PHP5, what is the difference between using self and $this? When is each appropriate?
- Previewing and plotting a single sheet in AutoCAD using .NET
- Difference between ArrayList and Vector in Java
- Difference between using bean id and name in Spring configuration file
- Difference between Vector and ArrayList in java?
- Previewing and plotting multiple sheets in AutoCAD using .NET
- Data Transfer between Business and Data Access Components in Enterprise Applications using .Net
- An example in sklearn: Faces recognition example using eigenfaces and SVMs
- Example of Using Google Maps Service and GPS in Android
- An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically
- find element in both array and vector using one myfind function
- Difference between ArrayList and Vector In java
- Java - Difference between ArrayList and Vector in Java
- Difference between Truncate and Delete command in SQL - Interview Questions with Example
- Tree in Combo Box example code (using HTTPService and XML)
- Difference Between Vector and Deque in C++
- Build Google IG like Ajax Start Page in 7 days using ASP.NET Ajax and .NET 3.0