Coloring regions and plotting boundaries

7 ビュー (過去 30 日間)
Hani Haidar
Hani Haidar 2019 年 10 月 8 日
コメント済み: darova 2019 年 10 月 8 日
Hello I am solving a question about bayesian decision in which I have to plot P(w1/x) and P(w2/x) and color the decision regions and set vertical line boundaries for each region as in the attached photo. I know how to write the equations and do the plot but I have no prior experience in coloring the regions and setting the boundaries. If you can give me any help I would be very grateful. Thank you

回答 (1 件)

darova
darova 2019 年 10 月 8 日
Use can use patch() !
x = linspace(0,10);
y = sin(x);
plot(x,y)
p = patch([1 1 2 2],[-1 1 1 -1],'');
set(p,'FaceAlpha',0.2)
set(p,'EdgeColor','none')
img1.png
  2 件のコメント
Hani Haidar
Hani Haidar 2019 年 10 月 8 日
The problem is that I don't know the boundaries. I want to color the region where P(w1/x) > P(w2/x) and vice versa each in a different color
darova
darova 2019 年 10 月 8 日
I think intersections should be found

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by