Update:
I have modified the function as follows:
function obj = gatrial (ip1,ip2,ip3,ip4)
% --------all eqns and ode call-------------
obj = Result_Final (end,2);
end
And also defined a GA optimization function as follows:
options = gaoptimset ('UseParallel', true, 'PopulationSize', 200)
lb=[- - - -];
ub=[- - - -];
[X fval] = ga(@gatrial,4,[],[],[],[], [lb],[ub],[], options);
Now how to get the optimal results for ip1- ip4 such that obj could be minimized?
Though ip1-4 are used ultimately in calculation of obj value, i can't write a simple straightforward equation like obj = ----*ip1+---*ip2... etc., as shown in most of the examples. I am kinda confused on how to solve this kind of problem through optimization. should i create a matrix with obj and also the 4 ips?
Any help will be appreciated.
Thanks.