Borrar filtros
Borrar filtros

Help with rbbox function

5 visualizaciones (últimos 30 días)
B_Richardson
B_Richardson el 8 de Jul. de 2011
Hello community,
I have this code that uses the rrbox function:
k = waitforbuttonpress;
point1 = get(gca,'CurrentPoint'); % button down detected
finalRect = rbbox; % return figure units
point2 = get(gca,'CurrentPoint'); % button up detected
point1 = point1(1,1:2); % extract x and y
point2 = point2(1,1:2);
p1 = min(point1,point2); % calculate locations
offset = abs(point1-point2); % and dimensions
x = [p1(1) p1(1)+offset(1) p1(1)+offset(1) p1(1) p1(1)];
y = [p1(2) p1(2) p1(2)+offset(2) p1(2)+offset(2) p1(2)];
hold on;
axis manual;
plot(x,y,'r','linewidth',5); % draw box around selected region
Which does work. But I wanted to ask how can change this code to allow for multiple selections of points? And then save all of the points?

Respuestas (0)

Categorías

Más información sobre Board games en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by