How to select a rectangle on a graph?
Ältere Kommentare anzeigen
Hi everyone :)
I cannot use the image processing toolbox function 'getrect' which lets you draw a rectangle on a graph and get its information (min X, min Y, width and length). I don't have the toolbox and it will take long time to get hold of it. I want to have this ability using standard Matlab only. How to do that?
Any help will be welcomed and appreciated, Alon
Antworten (1)
KSSV
am 6 Nov. 2016
0 Stimmen
doc imrect.
4 Kommentare
Alon Rozen
am 6 Nov. 2016
KSSV
am 6 Nov. 2016
Then go for ginput. doc ginput.
Alon Rozen
am 7 Nov. 2016
KSSV
am 7 Nov. 2016
How about this?
clc; clear all ;
plot(rand(10,1))
rectangle('Position',[0.59,0.35,3.75,1.37],...
'LineWidth',2,'LineStyle','-')
You can change position, length and width.
Other option is. You can insert rectangle on the figure, go to insert > Rectangle. You can drag drop, adjust it's position, length and width. Then you can call ginput to get positions.
Kategorien
Mehr zu Data Exploration finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!