研发埠

标题: Matlab中W(i,idx(i,2:k+1)) = 1;此句怎么解释? [打印本页]

作者: 姜龙    时间: 2013-5-23 11:03
标题: Matlab中W(i,idx(i,2:k+1)) = 1;此句怎么解释?
编译的时候,此句显示错误,请求指导,错误为Index exceeds matrix dimensions.我的代码是:[nFea, nSmp] = size(X);    D = L2_distance_1(X,X);    W = spalloc(nSmp,nSmp,20*nSmp);    [dumb idx] = sort(D, 2); % sort each row    for i = 1 : nSmp        W(i,idx(i,2:k+1)) = 1;             end    W = (W+W')/2;




欢迎光临 研发埠 (http://bbs.yanfabu.com/) Powered by Discuz! X3.2