I want to have plot of variable (m) value and objective function values (-fval) in "x","y" axis respectively, I can evaluate the values of "fval" but can't plot the desired results.
Following is my working programme:
fun = @(x)sum((x.*(log(x)))); A = []; b = []; x0 = [1/6 1/6 1/6 1/6 1/6 1/6]; lb = [0,0,0,0,0,0]; ub = [1,1,1,1,1,1]; Aeq = [1,1,1,1,1,1;1,2,3,4,5,6]; for m=1:0.5:6; beq = [1;m]; [x,fval] = fmincon(fun,x0,A,b,Aeq,beq,lb,ub); plot(m,-fval); end
Best Answer