GA optimasation error during the running , the subcript indices must be integer positive or logical?
이전 댓글 표시
i define my fiteness function for the GA using 'assignin' expression
function [y]=myfiteness(x)
assignin('base','na',x(1));
assignin('base','nb',x(2));
[~,~,Y]=sim('mymodel',[0,1]);
y=y(end,2);
after using otimtool for GA for the function , the running stops and a message apear in the running section of the optimtool which show the following ''the subcript indices must be integer positive or logical''
so how to solve this problem????????
댓글 수: 3
Walter Roberson
2022년 3월 8일
y=y(end,2);
You do not have variable y at that point, you have Y
What happens if Y is empty?
khelifa siham
2022년 5월 8일
Walter Roberson
2022년 5월 8일
What happens if sim() returns an empty variable at that point?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!