Solving systems of equations in Matlab -
how solve these equations in matlab?
lines 1 , 3 independent lines 2 , 4, , can solved easily.
regarding lines 2 , 4, can solve them using genetic algorithms gamultiobj (which give set of approximate solutions, aka. pareto frontier):
run_ga.m:
fitnessfunction = @objectives; numberofvariables = 2; options = gaoptimset('generations', 100, 'populationsize', 100); [x,fval,exitflag,output] = gamultiobj(fitnessfunction,numberofvariables,[],[],[],[],[],[],options)
objectives.m:
function y = objectives(x) w = x(1); y = x(2); y(1) = abs(2*w*y-2*w+1); y(2) = abs(2*w+y^2-2*y-1);
Comments
Post a Comment