Error using pdist The distance function
7 次查看(过去 30 天)
显示 更早的评论
Hello everyone, I have a CSV database, I import this database into mathlab and call them ab_table_Stool_real and Ko_table_Stool_real. However, when I run them in the code below, the following error appears: Error using pdist. The distance function 'distfun_WeightedJaccard' was not found. I would really appreciate it if anyone knows what's going on.
%% Taxonomic diversity, Functional diversity, and Functional redundancy calculation
% filtering
ab_table_real=ab_table_real(:,sum(ab_table_real>0,1)>5);
% Real taxonomic profile
dij_real=pdist(ko_table_real,@distfun_WeightedJaccard);
[SD_real, FD_real, FR_real]=FDFR_Rao_q (ab_table_real, dij_real);
% Null-GCN-1
ko_table_NULL_1=KO_matrix_random(ko_table_real,1);
dij_NULL_1=pdist(ko_table_NULL_1,@distfun_WeightedJaccard);
[SD_NULL_1, FD_NULL_1, FR_NULL_1]=FDFR_Rao_q (ab_table_real, dij_NULL_1);
% Null-GCN-2
ko_table_NULL_2=KO_matrix_random(ko_table_real,2);
dij_NULL_2=pdist(ko_table_NULL_2,@distfun_WeightedJaccard);
[SD_NULL_2, FD_NULL_2, FR_NULL_2]=FDFR_Rao_q (ab_table_real, dij_NULL_2);
% Null-GCN-3
ko_table_NULL_3=KO_matrix_random(ko_table_real,3);
dij_NULL_3=pdist(ko_table_NULL_3,@distfun_WeightedJaccard);
[SD_NULL_3, FD_NULL_3, FR_NULL_3]=FDFR_Rao_q (ab_table_real, dij_NULL_3);
% Null-GCN-4
ko_table_NULL_4=KO_matrix_random(ko_table_real,4);
dij_NULL_4=pdist(ko_table_NULL_4,@distfun_WeightedJaccard);
[SD_NULL_4, FD_NULL_4, FR_NULL_4]=FDFR_Rao_q (ab_table_real, dij_NULL_4);
2 个评论
Star Strider
2022-6-15
You are apparently using code originally written by someone else, who created the ‘distfun_WeightedJaccard’ function. You will need to look for it in the code you are using, and then put the function somewhere in your MATLAB search path.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!