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.
Walter Roberson
2022년 6월 15일
https://github.com/liangtian85/FR/blob/master/distfun_WeightedJaccard.m
답변 (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!