我用了下这个程序,在 Pcum=cumsum(P);%cumsum计算数组各行的和Select=find(Pcum>=rand);to_visit=J(Select(1));处出错,显示Select(1)=0可以帮忙吗?
不知道你用的是什么语言,建议你查查手册。