Filter löschen
Filter löschen

plot the region represented by 'ABS (x) + abs (y)≤1'

6 Ansichten (letzte 30 Tage)
军 川
军 川 am 14 Apr. 2022
Kommentiert: 军 川 am 14 Apr. 2022
I know the picture of this inequality, but he has x and y as variables. How do I plot it

Akzeptierte Antwort

Chunru
Chunru am 14 Apr. 2022
If you don't want to derive the boundary of the surface, you can do the following:
[xx, yy] = meshgrid(linspace(-2, 2), linspace(-2,2));
zz = ones(size(xx));
zz( (abs(xx) + abs(yy)) > 1) = nan;
surf(xx, yy, zz, 'EdgeColor', 'none'); view(0, 90); axis equal
  1 Kommentar
军 川
军 川 am 14 Apr. 2022
Thank you.I've been experimenting with a two-dimensional approach, and I didn't realize that the three-dimensional representation worked so well.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by