plot minimum spanning tree

1 回表示 (過去 30 日間)
shuaa alharbi
shuaa alharbi 2016 年 6 月 8 日
I calculated MST according to the euclidian distance between each point. I used this code to colored the MST edges according to weight but it doesn't work !!
%% Compute minimal spanning tree [G,pred] = graphminspantree(G,'Method','Kruskal');
%% nn = 20; cmap = jet(nn); p1 = min(pred); p2 = max(pred); [h,idx] = histc(pred,p1:(p2-p1)/(nn-1):p2); x = V(:,1); % graph vertices y = V(:,2); figure; for i=1:length(pred) plot(x(i),y(i),'-','color',cmap(idx(i),:)); >>> the proplem here hold on; end end

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by