使用每个顶点的颜色在 matlab 中绘制图形

Plot a graph in matlab using a color for each vertex

我需要根据三个参数绘制图形:

图邻接矩阵X(n*n) 每个顶点的二维坐标矩阵 V(n*2) 包含每个顶点颜色的矩阵,使用 rgb 组合 (n*3)

有什么工具可以用于此目的吗?

我想这就是你想要的

%// i took some random values as your input was not clear. 
%// you could replace it with your own values.

V = [ 18    15 ;  
      14    19 ;
       8    19 ;
       3    17 ;
       0    12 ;
       0     4 ;
       2     4 ; 
       8     5 ;
      14     9 ;
       4    20 ; 
      20    10]; 

C = rand(11,3);  %// replace it with your original color matrix
k = 1:11;
hold on
scatter(V(:,1), V(:,2), [],C,'filled');
gplot(X(k,k),V(k,:),'-');
text(V(:,1), V(:,2),[repmat('  ',11,1), num2str((1:11)')]);
hold off

输出: