How to pass several anonymous functions to the anonymous fitness function in gamultiobj()?

조회 수: 1 (최근 30일)
Hi,
i want to optimize a problem with several objectives using gamultiobj(). I have 3 objective funtions, which i want to pass to the parameter fitnessfcn
The Matlab documentation for gamultiobj states, that this can e.g. be done like this:
fitnessfcn = @(x)[sin(x),2*cos(x)+2,4*tan(x)];
The actual objective functions, that I want to use are unfortunately not as straight forwart as sin(x) etc. and require more input:
objective1 = @(x) minimize_val1(x,input);
objective2 = @(x) minimize_val2(x,input);
objective3 = @(x) minimize_val3(x,input);
How do I pass those 3 anonymus functions to the fitnessfcn?
Thanks in advance!

채택된 답변

Matt J
Matt J 2021년 11월 5일
편집: Matt J 2021년 11월 5일
objective1 = @(x) minimize_val1(x,input1);
objective2 = @(x) minimize_val2(x,input2);
objective3 = @(x) minimize_val3(x,input3);
fitnessfcn = @(x)[objective1(x),objective2(x),objective3(x)];
or, even more directly,
fitnessfcn = @(x)[minimize_val1(x,input1),...
minimize_val2(x,input2),...
minimize_val3(x,input3)];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multiobjective Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by