matlab程序运行不出结果 function tau=kendalltau(order1,order2)[dummy,ranking1]=sort(order1(:)',2,'ascend');[dummy,ranking2]=sort(order2(:)',2,'ascend');N=length(ranking1);[ii,jj]=meshgrid(1:N,1:N);ok=find(jj(:)>ii(:));ii=ii(ok);jj=jj(ok);nok=l
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 06:46:06
matlab程序运行不出结果 function tau=kendalltau(order1,order2)[dummy,ranking1]=sort(order1(:)',2,'ascend');[dummy,ranking2]=sort(order2(:)',2,'ascend');N=length(ranking1);[ii,jj]=meshgrid(1:N,1:N);ok=find(jj(:)>ii(:));ii=ii(ok);jj=jj(ok);nok=l
matlab程序运行不出结果
function tau=kendalltau(order1,order2)
[dummy,ranking1]=sort(order1(:)',2,'ascend');
[dummy,ranking2]=sort(order2(:)',2,'ascend');
N=length(ranking1);
[ii,jj]=meshgrid(1:N,1:N);
ok=find(jj(:)>ii(:));
ii=ii(ok);
jj=jj(ok);
nok=length(ok);
sign1=ranking1(jj)>ranking1(ii);
sign2=ranking2(jj)>ranking2(ii);
tau=sum(sign1~=sign2);
lambda=0.1;
labels ={'Washington','Adams','Jefferson','Madison','Monroe'};
omega=[1 2 3 4 5];
L=length(omega);
T=500;
seed=1;rand('state',seed);randn('state',seed );
theta=zeros(L,T);
theta(:,1)=randperm(L);
t =1;
while t
matlab程序运行不出结果 function tau=kendalltau(order1,order2)[dummy,ranking1]=sort(order1(:)',2,'ascend');[dummy,ranking2]=sort(order2(:)',2,'ascend');N=length(ranking1);[ii,jj]=meshgrid(1:N,1:N);ok=find(jj(:)>ii(:));ii=ii(ok);jj=jj(ok);nok=l
粗略看了一下,发现在kendalltau中有个dist1=kendalltau(theta_star,omega);的调用,这一个定义的函数中再调用 这个函数,这种循环的调用,是否可以?我也不懂,讨论一下,也许问题在此吧