How to split time series array into subarrays according to sampling rate?
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have a data acquired from ECG sensor sampled at 128 sps I want to make subarrays each contains 256 sample?
0 个评论
回答(1 个)
Krithika A
2018-7-24
编辑:Krithika A
2018-7-24
sps = 128;
n = 768; % 128*6 = 768, so a 6s long signal with 128 sps
x = randn(1,n);
y = reshape(x, [], sps*2);
9 个评论
Guillaume
2018-7-25
It should be indeed
reshape(x, [], 50)
to divide the data into 50 columns or even better:
reshape(x, 256, [])
to split the data into columns of 256 elements. In each case, each subarray ends up as a column.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!