Adding feasible region on a Contour plot
Ältere Kommentare anzeigen
Hi,
I am trying to plot a contour of an optimization problem and also determine the feasible region for the function.
I have been able to generate the contout plot but I I don't know how to plot the feasible region when the constraint is X > 0.
Example of my code is shown below.
Assuming the constraints is given by:
Thank you for your help
x = -5:0.005:5;
y = -5:0.005:5;
[X,Y] = meshgrid(x,y);
F = (X.^2+Y-11).^2 + (X + Y.^2 - 7).^2;
v = [0:2:10 10:10:100 100:20:200]
[c,h]=contour(X,Y,F,v,'linewidth',2);
2 Kommentare
DGM
am 10 Apr. 2021
It depends how you want to represent it. Do you want the whole plot from -5:5 with some sort of lines or mask to delineate the feasible region, or do you just want to plot the feasibile region alone?
Telema Harry
am 10 Apr. 2021
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Contour Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



