How can I incrementally plot multiple Rectangles in a [X Y Width Height] field?

I want incremental rectangle plots on a (ExtractedX, ExtractedY) graph currently, I have...
PED_fld = [132 210 75 80]
figure
plot(ExtractedX, ExtractedY);
rectangle ('position', PED_fld); %PED
This give me a rectangle spanning [132 210 75 80] or [X Y Width Height]
but I want multiple equally spaced rectangles in this range, not one

 Risposta accettata

for i=1:10
PED_fld=[132+i 210-i 75 80]
rectangle('position', PED_fld); %PED
hold on;
end

5 Commenti

Thank you! This seems much closer, however this code is giving me the figure alone, and the rectangles alone, and no loger plots the rectangle on the graph. Such is an example of the desired effect
Screen Shot 2020-01-22 at 1.35.45 PM.png
for i=1:10
PED_fld=[132+i 210+i 75 80]
rectangle('position', PED_fld); %PED
hold on;
end
71.png
yes, I got this figure, but can it be plotted on the graph such as the picture I attatched in my response?
Is there a possibilty of the rectangle figure not being 4 dimesional and a flat incremental plot as in the picture i drew

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange

Prodotti

Richiesto:

Su
il 22 Gen 2020

Commentato:

Su
il 23 Gen 2020

Community Treasure Hunt

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

Start Hunting!

Translated by