how to write objective function for 4 variables

조회 수: 2(최근 30일)
MD NASAR
MD NASAR 2012년 7월 1일
Hi All i want to write a objective function for 4 variables and i want all 4 variables value in output, how to write it please help me.
Thank you.
  댓글 수: 1
Yash
Yash 2012년 7월 8일
post here the type of function and variables

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

답변(1개)

Walter Roberson
Walter Roberson 2012년 7월 8일
function y = myObjective(x)
first_variable = x(1);
second_variable = x(2);
third_variable = x(3);
fourth_variable = x(4);
...
y = ....
end
Then any of the optimization functions will report the vector of four values that optimized the objective.

Community Treasure Hunt

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

Start Hunting!

Translated by