close all

%% Plotting example

k2=length(vectors);

if k2==2
for j=1:N
    plot(Cluster(j).id(:,1),Cluster(j).id(:,2),'o');hold on;axis square
    plot(Cluster(j).Center(1),Cluster(j).Center(2),'kx','MarkerSize',16,'LineWidth',2)
end
xlabel(ClusterColumns(1),'FontSize',14,'Interpreter','none')
ylabel(ClusterColumns(2),'FontSize',14,'Interpreter','none')
cd Outputs_Clustering\;saveas(gcf,'Cluster_output.jpg');cd ../

elseif k2==3
for j=1:N
    plot3(Cluster(j).id(:,1),Cluster(j).id(:,2),Cluster(j).id(:,3),'o');hold on;grid on;axis square
    plot3(Cluster(j).Center(1),Cluster(j).Center(2),Cluster(j).Center(3),'kx','MarkerSize',16,'LineWidth',2)
    end
xlabel(ClusterColumns(1),'FontSize',14,'Interpreter','none')
ylabel(ClusterColumns(2),'FontSize',14,'Interpreter','none')
zlabel(ClusterColumns(3),'FontSize',14,'Interpreter','none')
cd Outputs_Clustering\;saveas(gcf,'Cluster_output.jpg');cd ../
end


if strcmp(Meth,'Hierarchical')==1;
    figure;[H,T,outperm]=dendrogram(L,Lnodes,'ColorThreshold', L(length(L)-N+2,3));
cd Outputs_Clustering\;saveas(gcf,'Dendrogram_output.jpg');cd ../;end



  