Optimisation application: how do I create the fitness function?
이전 댓글 표시
I have two functions: EndCarb and EndCost.
These functions use inputs of: ID [1 2] and Q [0.000001:0.000001:0.01], and give an output of carbon quantity and cost respectively. (EndCarb [ID,Q]; EndCost[ID,Q])
I want to use the gamultiobj tool to optimise the inputs of ID and Q to give the pareto optimal cost and carbon. So far I have been attempting to write a script along the lines of:
fun(1) = @(ID,Q) EndCost(ID,Q);
%parameterised function
Q=0.000001:0.000001:0.01;
%parameter
fun1a=@(ID) fun(1)(ID,Q);
%function of ID alone
ID=[1,2];
fun(2) = @(ID,Q) EndCarbon(ID,Q);
%parameterised function
Q=0.000001:0.000001:0.01;
%parameter
fun2a=@(ID) fun(2)(ID,Q);
%function of ID alone
ID=[1,2];
% Combine two objectives 'fun1' and 'fun2'
fun1and2 = @(ID,Q) [fun(1)(ID,Q) fun(2)(ID,Q)];
I'm not sure if this is the right track, as I am unable to get it to work. Can anybody advise anything?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!