Filter löschen
Filter löschen

Rectangular Box plotting from four co-ordinate

1 Ansicht (letzte 30 Tage)
BILLAL Hossain
BILLAL Hossain am 8 Sep. 2021
Beantwortet: Chunru am 9 Sep. 2021
Hi, I am trying to plot a rectangular box in a xlim([0 25]) ylim([0 25]). I have co-ordinate values of four point and tried following code:
x_points = [x1 x2 x3 x4];
y_points = [y1 y2 y3 y4];
caustom_plot=plot(x_points,y_points,'k','Linewidth',2);
It shows a rectangular shape but one side is open. How can i fix the issue?

Antworten (1)

Chunru
Chunru am 9 Sep. 2021
caustom_plot=plot(x_points([1:end 1]),y_points([1:end 1]),'k','Linewidth',2);

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by