writing correct fitness function for GA
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hi Friends, Please can anyone help me correct this GA code to minimimize measured and predicted results to extract the three parameters.I got an error message when I run it on matlab GA tool. function Ap = insertionlossnew(x) L1=3; Zcd1=x(1); L2= 24; Zcb=x(2); L3=3; Zcd2=x(3); Ap=eye(1); for f=[1 4 8 10 16 20 25 31.25 62.5 100 200 250 300 400 500]; Ap = (f*((L1)*(Zcd1)+(L2)*(Zcb)+(L3)*(Zcd2))); end Am=[20.3 23.4 24.6 25.3 23.4 26.4 27.5 22.9 23.7 29.8 31.3 32.8 27.9 25.8 35.6]; Y1=sqrt(sum(Ap-Am)^2); Y2=mean(Am,15); disp(Y2); Y3=sqrt(sum(Am-Y2)^2); Y4=Y1/Y3; Y=(1-Y4)*100; disp(Y);
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!