代码拉取完成,页面将自动刷新
fprintf('\n');
disp('MultiDimensional Scaling ') ;
disp('Classical MDS');
[Y1,e] = cmdscale(double(disMat));
% Plot EigenValues
figure;
subplot(2,1,1);
plot(1:min(Pat^2,disDim2),e(1:min(Pat^2,disDim2)));
graph2d.constantline(0,'LineStyle',':','Color',[.7 .7 .7]);
axis([1,min(Pat^2,disDim2),min(e),max(e)*0.9]);
xlabel('Eigenvalue number');
ylabel('Eigenvalue');
% Plot Correlation Coefficients
% subplot(2,1,2);
% hold on
% corrs=[];
% for i=1:5:min(size(Y1,2),Pat^2)
% CORR = corrcoef(disMat,squareform(pdist(Y1(:,1:i))));
% corrs=[corrs CORR(1,2)];
% end
% plot(1:5:min(size(Y1,2),Pat^2),corrs,'ko-','MarkerEdgeColor','r','MarkerFaceColor','k','MarkerSize',8);
% xlabel('Dimension');
% ylabel('Correlation coefficient');
% Do MDS
MDS = input('What is the MDS dimension ? ') ;
maxerr = max(abs(pdist(X)-pdist(Y1(:,1:MDS)))) %#ok<NOPTS>
Y = Y1(:,1:MDS);
% Plot final distances' correlation
% MDStest = squareform(pdist(Y));
% figure;
% plot(disMat,MDStest,'b.');
% CORR = corrcoef(disMat,MDStest);
% xlabel('Dissimilarity distance');
% ylabel(['Euclidean distance in ',num2str(MDS),' D']);
% title(['Correlation Coefficient = ',num2str(CORR(1,2))]);
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。