1 Star 0 Fork 0

Admin/marx_DisPAT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
multiDimScale.m 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
marx 提交于 2021-11-26 19:53 . v1
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/marx_1_1307066363/marx_-dis-pat.git
git@gitee.com:marx_1_1307066363/marx_-dis-pat.git
marx_1_1307066363
marx_-dis-pat
marx_DisPAT
master

搜索帮助