Matlab程序运行中,出现了如下错误,怎么调试?
程序如下:functionx=transform2to10(population);BitLength=size(population,2);x=population(B...
程序如下:
function x=transform2to10(population);
BitLength=size(population,2);
x=population(BitLength);
for i=1:BitLength-1
x=x+population(BitLength-i)*power(2,i);
end
end
运行一个主程序是,用到该函数,但是,出现了Attempted to access population(0); index must be a positive integer or logical.的错误,请问怎么调试啊? 展开
function x=transform2to10(population);
BitLength=size(population,2);
x=population(BitLength);
for i=1:BitLength-1
x=x+population(BitLength-i)*power(2,i);
end
end
运行一个主程序是,用到该函数,但是,出现了Attempted to access population(0); index must be a positive integer or logical.的错误,请问怎么调试啊? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询