Best way to truncate imported data so the plot displays the area of interest
57 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Meliton Flores
el 22 de Dic. de 2020
Comentada: Meliton Flores
el 23 de Dic. de 2020
I'm writing a simple script that runs a massive amount of data (over a million rows) through two equations and plots the results. What I need is a way to have matlab chop off a good portion of the beginning and end of the data without editing the original .csv file or going through and doing so while importing the data. Right now it's not plotting enough of the data to reach the point of interest. I was advised to try a premade function called getArrayEditorBrushCache to have it brush the parts of data I want but I'm pretty new to matlab and I'm not sure how to set that function up for use. Does anyone know any easy way around this? This will eventually be turned into a GUI.
3 comentarios
Respuesta aceptada
per isakson
el 23 de Dic. de 2020
Editada: per isakson
el 23 de Dic. de 2020
One simple interactive way (R2018b)
%% some data
noise = rand( 0.5e6, 1 );
roi = 4.5*sin( (1:5e3)/(20*pi) )';
data = [ noise; roi; noise ];
x = 0.2 * ( 1 : numel(data) )';
%%
plot( x, data )
creates this figure. Clicking in the diagram displays the tool-buttons in the upper right corner.
Click the leftmost tool and select the interesting part. (Print screen doesn't capture all details.)
Right click in the selected area and choose Remove Unbrushed
Repeat the above step to narrow down the region
And click in the diagram to remove the "brushing". Done!
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots 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!