Finding segments of data using time stamps in one column to the corresponding data in another column of the same matrix. Output each segment of data into separate matrix row or cell array

1 次查看(过去 30 天)
Hi,
I am trying to find segments of data from intervals of start and stop times. The data is a matrix with data in the first column and time stamps in the second column that correspond to the interval times. I would like to get the data in the first column that corresponds to the time stamps in the second column. I would also like the out put interval (there are multiple intervals, in the samples I provided there are 3) to be that each segment is in a separate matrix row or column or even cell array (any is find I just want them to be separate). I have tried some code but am getting empty cell array outputs:
for i=1:numel(interval(:,1))
w=interval(i,:);
output{i}=intersect(data(find(data>=w(1))),data(find(data<=w(2))));
end
I have attached an example of data in a matrix data and intervals in matrix interval. Any help would be wonderful.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by