本文介绍了如何绘制不等式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想绘制以下不等式:y p(1 - p) 和 x <p(1 - ( y/(1 - p))).

I would like to plot the following inequalities:y < p(1 - p) and x < p(1 - ( y / (1 - p))).

鉴于第一个满足,我想绘制两个都满足的区域.
pp 可以在 [0,1] 范围内变化.

Given that the first is satisfied, I want to plot the region in which both are satisfied.
p and p can vary within [0,1].

我将不胜感激!

推荐答案

试试这个:红色区域是两个不等式都满足的地方.

Try this: The red area is where both inequalities are satisfied.

[X,Y]=meshgrid(0:0.01:1,0:0.01:1); % Make a grid of points between 0 and 1
p1=0.1; p2=0.2; % Choose some parameters
ineq1 = Y<p2*(1-p1);
ineq2 = X<p1*(1-(Y./(1-p1)));
colors = zeros(size(X))+ineq1+ineq2;
scatter(X(:),Y(:),3,colors(:),'filled')

这篇关于如何绘制不等式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-11 17:39