how to extract the data for specific interval?
7 次查看(过去 30 天)
显示 更早的评论
I have a datasets of time and value with time interval 0.1 sec. But, I want to extract the value and corresponding time for 0.5 sec from that. Please provide me any suggestion. Thanks.
0 个评论
采纳的回答
Star Strider
2021-11-12
I am not exactly certain what the desired result is, however the retime funciton will likely produce it, regardless.
Assuming that is to re-sample the table from 0.1 second resolution to 0.5 second resolution,
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/797754/Book2.xlsx', 'VariableNamingRule','preserve')
T1.time = seconds(T1.time); % Convert 'time' From Numeric To A 'duration' Array
TT1 = table2timetable(T1)
TT1 = retime(TT1, 'regular','linear', 'Timestep',seconds(0.5))
The interpolation method is required in the event that there are missing times. It does not affect values that already exist at the chosen times.
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!