How to plot a rectangle from a single point ?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Is there a way to plot a rectangle from a single point?
0 Commenti
Risposta accettata
Wan Ji
il 24 Ago 2021
Modificato: Wan Ji
il 24 Ago 2021
Hi,
Use rectangle function
rectangle('Position',[0,0,2,4]); % [x_left_down_corner, y_left_down_corner, length, width]
Use axis function make it look clear
axis([-1,3,-1,5])
axis equal
3 Commenti
Wan Ji
il 24 Ago 2021
It is not enough to have x and y, but still length and width are required.
length = 2;
width = 4;
rectangle('Position',[ex.x, ex.y, length, width]); % [x_left_down_corner, y_left_down_corner, length, width]
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!