Effacer les filtres
Effacer les filtres

Help with rbbox function

4 vues (au cours des 30 derniers jours)
B_Richardson
B_Richardson le 8 Juil 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?

Réponses (0)

Catégories

En savoir plus sur Board games dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by