필터 지우기
필터 지우기

Optimization cost function file

조회 수: 4 (최근 30일)
Mondeep maz
Mondeep maz 2018년 6월 8일
댓글: Walter Roberson 2022년 8월 20일
Is it possible that optimization can be done without creating a seperate function file for the cost function and the constraint?..if yes then how can we do it....?
  댓글 수: 5
sabreen farouq
sabreen farouq 2022년 8월 19일
where i can find this famous cost function ?
Walter Roberson
Walter Roberson 2022년 8월 20일
There are a few example cost functions such as rosenbeck, but mostly you write your own cost function depending on what you want to optimize.
See also Problem Based Optimization

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

채택된 답변

Walter Roberson
Walter Roberson 2018년 6월 9일
Each iteration of the objective function called by fmincon or ga or similar must involve the same number of variables, and must be deterministic (no random values.)
You can use different numbers of variables for different calls to the minimizer, including in a loop. That could involve creating a new anonymous function for each iteration of the loop.
An objective function which is just the sum of variables can be expressed as just @sum; for a weighted sum, @(x) sum(x.*weights) or more robustly @(x) sum(x(:).*weights(:)) to be sure you do not have row/column difficulties.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by