Adding feasible region on a Contour plot
古いコメントを表示
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 件のコメント
DGM
2021 年 4 月 10 日
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
2021 年 4 月 10 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



