Skip to Main Content Skip to Search
Product Documentation

plot::Inequalitydisplay areas where inequalities are fulfilled

plot::Inequality(f(x, y) < g(x, y), x = `x_{min}`..`x_{max}`, y = `y_{min}`..`y_{max}`) fills the rectangle (`x_{min}` <= x) <= `x_{max}`, (`y_{min}` <= y) <= `y_{max}` with several colors, indicating which points satisfy the inequality.

→ Examples

Calls:

plot::Inequality(ineq, x = `x_{min}` .. `x_{max}`, y = `y_{min}` .. `y_{max}`, <a = amin .. amax>, Options)

plot::Inequality([ineq1, ...], x = `x_{min}` .. `x_{max}`, y = `y_{min}` .. `y_{max}`, <a = amin .. amax>, Options)

Parameters:

ineq, ineq1, ...: 

inequalities to plot: Expressions of the form f(x, y) < g(x, y), f(x, y) <= g(x, y), f(x, y) = g(x, y), f(x, y) >= g(x, y), or f(x, y) > g(x, y)
ineq, ineq1, ... is equivalent to the attribute Inequalities.

x, y

identifiers or indexed identifiers. These denote the free variables spanning the plane. 
x, y are equivalent to the attributes XName, YName.

`x_{min}` .. `x_{max}`, `y_{min}` .. `y_{max}`

the ranges for x and y. `x_{min}`, `x_{max}`, `y_{min}`, and `y_{max}` mustbe real numerical values, or expressions of the animation parameter a
`x_{min}` .. `x_{max}`, `y_{min}` .. `y_{max}` are equivalent to the attributes XRange, YRange.

See Also:

plot, plot::copy, plot::Density, plot::Implicit2d, plot::Raster

Details:

Example 1

With a single inequality, plot::Inequality colors the area where it is fulfilled or violated, with areas at the border line, where the inequality is fulfilled in some parts of the rectangle and violated in other parts:

plot(plot::Inequality(x^2 + y^2 < 1,
                      x = -1.5..1.5, y = -1.5..1.5))

MuPAD graphics

When giving more than one inequality, only those areas where all inequalities are fulfilled are painted in blue (or whatever you set FillColorTrue to), while all rectangles where any inequality is violated (over the whole rectangle) are colored red:

plot(plot::Inequality([x^2 + y^2 < 1, abs(x) > 1/3],
                      x = -1.5..1.5, y = -1.5..1.5))

MuPAD graphics

Example 2

To get a more detailed image from plot::Inequality, increase the mesh density:

plot(plot::Inequality([x^2 + y^2 < 1, abs(x) > 1/3],
                      x = -1.5..1.5, y = -1.5..1.5,
                      Mesh = [120, 80]))

MuPAD graphics

Example 3

Almost all parameters of plot::Inequality can be animated (the mesh is one exception though):

plot(plot::Inequality([abs(x)^a + abs(y)^a < 1],
                      x = -1.5+sin(a)..1.5+sin(a),
                      y = -1.5+cos(a)..1.5+cos(a),
                      Mesh = [64, 64],
                      a = 1..2*PI+1))

MuPAD graphicsimage

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS