Filter löschen
Filter löschen

Help with rbbox function

5 Ansichten (letzte 30 Tage)
B_Richardson
B_Richardson am 8 Jul. 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?

Antworten (0)

Kategorien

Mehr zu Board games 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