plot_mst.m

来自「data description toolbox 1.6 单类分类器工具包」· M 代码 · 共 40 行

M
40
字号
function plot_mst(a,tree,c,lwidth)%PLOT_MST Plot minimum spanning tree%%    PLOT_MST(A,TREE,STR,LWIDTH)% % Plots the edges of a minimum spanning tree, defined by the nodes A and% TREE% % INPUT%      A        dataset%      TREE     list of edges%      STR      color e.g. 'k','m' or [0.9 0.1 0.7]%      LWIDTH   linewidth%% See also: mst_dd, datasets, mappings%  Copyright: Piotr Juszczak, p.juszczak@tudelft.nl%  Information and Communication Theory Group,%  Faculty of Electrical Engineering, Mathematics and Computer Science,         %  Delft University of Technology,            %  The Netherlandsif (nargin<2), error('At least 2 inputs expected');endif (nargin==2),lwidth=1;c='k';end[m,k] = size(a);mt = size(tree);if ((m-1)~=mt), error('The size of dataset does not much number of edges.'); endi=0;if ~ishold, hold on; i=1; endfor k=1:size(tree,1)    plot([+a(tree(k,1),1),+a(tree(k,2),1)],[+a(tree(k,1),2),+a(tree(k,2),2)],...        'linestyle','-','linewidth',lwidth,'color',c);endif i==1, hold off; endreturn;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?