figure('Units','normalized', ...
    'Name','HELP ON TREES', ...
  'Color',[0.8 0.8 0.8], ...
  'Position',[ 0.01375 0.2 0.0925 0.52 ]);
h1021=uimenu('Label','HELP ON TREES');
uimenu('Parent',h1021, ...
  'Callback','help cluster', ...
  'Label','UPGMA');
uimenu('Parent',h1021, ...
  'Callback','help addtree', ...
  'Label','NJ');
uimenu('Parent',h1021, ...
  'Callback','help contmap', ...
  'Label','discrim');
uimenu('Parent',h1021, ...
  'Callback','help mds', ...
  'Label','mds');


crds=[2 3;  4 2;  6 7; 5  3]
[n m]=size(crds);


%crdo=crds-ones(4,1)*mean(crds)
for i=1:n
	for j=1:n
       dist(i,j)=sum(abs( crds(i)-crds(j) ) ); 
    end;
end;
dist
%upgma

uicontrol('Units','normalized', ...
  'BackgroundColor',[0.964705882352941 0.247058823529412 0.105882352941176], ...
  'Callback','crds=[];dist=[];figure;[crds,grps] = getpts;[n,m]=size(crds);for i=1:n for j=1:n dist(i,j)=sum(abs( crds(i)-crds(j) ) ); end;end;',...
  'Position',[0.156521739130435 0.803664921465969 0.695652173913043 0.120418848167539 ], ...
  'String','GETPTS');
%UPGMA
uicontrol('Units','normalized', ...
  'BackgroundColor',[0.964705882352941 0.247058823529412 0.105882352941176], ...
   'Callback','figure;[topology,support] = upgma(dist);dendplot(topology);[anc,brlen] = topoanc(topology);title(''UPGMA'')',...
 'Position',[ 0.165217391304348 0.659685863874346 0.695652173913043 0.120418848167539 ], ...
  'String','UPGMA');
%NJ
uicontrol('Units','normalized', ...
  'BackgroundColor',[0.964705882352941 0.247058823529412 0.105882352941176], ...
  'Position',[ 0.165217391304348 0.520942408376963 0.704347826086957 0.117801047120419 ], ...
  'Callback','figure;[anc,brlen,support] = addtree(dist);title(''Neighbor Joining'')',...
  'String','NJA');
%Minimum spanning tree
uicontrol('Units','normalized', ...
  'BackgroundColor',[0.964705882352941 0.247058823529412 0.105882352941176], ...
  'Position',[ 0.156521739130435 0.37434554973822 0.704347826086957 0.117801047120419 ], ...
   'Callback','mstree(crds,1);title(''Minimum spanning tree'');',...
  'String','MS tree');
%Multi-Dimensional Scaling
uicontrol('Units','normalized', ...
  'BackgroundColor',[0.964705882352941 0.247058823529412 0.105882352941176], ...
  'Position',[ 0.156521739130435 0.230366492146597 0.704347826086957 0.117801047120419 ], ...
  'Callback','figure;mds(dist,[],2);title(''Coords from Multi-dimensional scaling to 1 dimension'')',...
  'String','MDS-1D');




  
