
Coloring regions and plotting boundaries
조회 수: 7 (최근 30일)
이전 댓글 표시

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
댓글 수: 0
답변 (1개)
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')

댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!