Variable in cost function should take only two values.

조회 수: 8 (최근 30일)
Mondeep maz
Mondeep maz 2018년 4월 30일
댓글: Mondeep maz 2018년 5월 5일
How can i set my objective function variable to take only 0 and 1 and not anything in between? I am using ga solver and my objective function is like min(f(x))= x(1) + x(2) + x(3) with constraint that (x(1) +x(2) + x(3))*0.2=0.4. Please help
  댓글 수: 6
John BG
John BG 2018년 4월 30일
편집: John BG 2018년 4월 30일
working in binary formay may come handy:
L=dec2bin(randi([0 100],1,1))
uint8(str2num(L(:))')
John BG
Mondeep maz
Mondeep maz 2018년 5월 5일
Thank you for the help guys.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by