How do i separate data?

2 views (last 30 days)
Fatima Bm
Fatima Bm on 7 Jan 2021
Commented: Fatima Bm on 8 Jan 2021
Hello everyone I attached data file. I want to separate data at interval of 20. How do this? Fs=20000 Data is time series.
  6 Comments
Adam Danz
Adam Danz on 7 Jan 2021
That means there are 20000 samples per second. If you want every 20 seconds, that's the same as every 20*fs samples which is what my answer does.
Fatima Bm
Fatima Bm on 8 Jan 2021
Ok, thanks. I ran the code but I didn't get a result

Sign in to comment.

Accepted Answer

Adam Danz
Adam Danz on 7 Jan 2021
Edited: Adam Danz on 7 Jan 2021
Assuming fs is the sampling frequency in Hz,
load('06-11_36.mat')
resampleInteval = 20; % seconds
dataResampled = data(1 : fs*resampleInteval : end);
Alternatively, see resample() which offers additional interpolation methods.

More Answers (0)

Categories

Find more on Behavior and Psychophysics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!