![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/173824/image.png)
Choosing specific area of points from xscale in plot
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello everyone, I'd like to know, if there is any tool, which helps me to choose certain area from plot, returning the range of chosen area?
more specific, I have signal with 5,000,000 samples (let it be from 1 to 5M). I want to plot graph and choose the area, which I am interrested in and I need to get the range of x scale.
Example: I need to work with 10 minutes of data near the half. So I need to mark this area and recived vector, containing numbers for example from 2,458,356 to 2,534,675.
Do you have any ideas? Thanks for any help
Tom
0 comentarios
Respuestas (2)
Giorgos Papakonstantinou
el 11 de Mzo. de 2015
Editada: Giorgos Papakonstantinou
el 11 de Mzo. de 2015
Hallo Tom. One way is to use brush/Select Data tool:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/173824/image.png)
(apologize for the bad resolution).
If you want better accuracy you can do:
x = get(myplot, 'Xdata');
y = get(myplot, 'Ydata');
idx = x>=2458356 & x<=2534675; % logical indexing of the "area" you are interested
sampleX = x(idx); % x values of the area of interest
sampleY = y(idx); % y values of the area of interest.
where myplot is the handle for your plot.
i.e.
myplot = plot(..., ...)
0 comentarios
Ver también
Categorías
Más información sobre Time Series Objects en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!