In a constrained optimization if "beq" is a matrix with a variable, then how to plot the variable in "beq" and the objective function?
Show older comments
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
12 Comments
KSSV
on 19 Jun 2018
What difficulty you facing? What is your problem or error?
Amritansu Ray
on 19 Jun 2018
Ameer Hamza
on 19 Jun 2018
@Amritansu, have you tried the code I gave in the answer?
Amritansu Ray
on 19 Jun 2018
Amritansu Ray
on 19 Jun 2018
Ameer Hamza
on 19 Jun 2018
It depends on how you want to use triangular fuzzy numbers here. If m is just a numeric vector then there is no difference.
Amritansu Ray
on 19 Jun 2018
Edited: Amritansu Ray
on 19 Jun 2018
Ameer Hamza
on 19 Jun 2018
The problem is still not quite clear. You have three values in m, and those are also shown on the x-axis. What are the values on the y-axis? From these two lines, what is the solution which you want?
Amritansu Ray
on 19 Jun 2018
Ameer Hamza
on 19 Jun 2018
To make the things simple, can you tell what value will m take in first and second subproblem? In first subproblem, the x change from [1.75, 3] and y from [0, 1]. So what does it mean to find the solution of the first subproblem? What are the values of m for which we need to optimize the objective function?
Amritansu Ray
on 20 Jun 2018
Amritansu Ray
on 20 Jun 2018
Accepted Answer
More Answers (0)
Categories
Find more on Linear Programming and Mixed-Integer Linear Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!