フィルターのクリア

Best way to truncate imported data so the plot displays the area of interest

53 ビュー (過去 30 日間)
Meliton Flores
Meliton Flores 2020 年 12 月 22 日
コメント済み: Meliton Flores 2020 年 12 月 23 日
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 件のコメント
Meliton Flores
Meliton Flores 2020 年 12 月 22 日
That's the size of my data. Some background: it's the voltage reading from an oscilliscope in microseconds. We are trying to set up the code so that someone can just take all the data from a scope and plug it right into the GUI and get the activity they tested for plotted.
In this certain test the area of interest is between 60 and 70 micro seconds. The time before the start of the test takes up the majority of the plot. The ability to choose the parts of the data interactively is desireable. Maybe a slider tool to make limits on the data.
Meliton Flores
Meliton Flores 2020 年 12 月 22 日
here's the plot

サインインしてコメントする。

採用された回答

per isakson
per isakson 2020 年 12 月 23 日
編集済み: per isakson 2020 年 12 月 23 日
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!
Next see App Building and search the File Exchange for tag:slider and more.

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by