Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

In MATLAB , how can i plot an inequality?

the plot function works as plot(x,y);

However i need to plot this inequality:

|x| + |y| <= 1

(the bars indicate the absolute value)

help please, thanx

Update:

I need a 2D graph,

This inequality looks lika a diamond (a square rotated 45 degrees) centered at the origin.

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    Have you ever thought of a 3D graph ?

    |x| on OX axis

    |y| on OY axis

    |x|+|y| on OZ axis

    You'll have to inspect by eye the values on OZ.

    I gave this solution from my experience with MathCAD.

Still have questions? Get your answers by asking now.