遗传算法出现问题。

6 visualizaciones (últimos 30 días)
jihale
jihale el 24 de Nov. de 2022
Respondida: gexik el 24 de Nov. de 2022
Attempted to access fitvalue(21); index out of bounds because numel(fitvalue)=20.
Error in selection (line 20)
if(ms(newin))<fitvalue(fitin)
Error in main (line 20)
[newpop]=selection(pop,fitvalue); %复制
程序中迭代次数改成10000的时候一直出现这个问题

Respuesta aceptada

gexik
gexik el 24 de Nov. de 2022
fitvalue 只有20个元素,程序却试图访问第21个元素。也就是这一句 if(ms(newin))<fitvalue(fitin) 访问到了第21个元素。You know

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!