Reshape dataset with time intervals?
이전 댓글 표시
I have a dataset with time(in seconds) in the first column and price for each time stamp in the second column. The increments in seconds are random, so i want to create 10 second time intervals in my data.
I then want to select the price from the data that lies the closest to the upper-limit of the time-interval, as the price value for that given interval. I have tried setting up a loop but i dont know how to tell matlab to choose the first value within each interval, as the position of this first value varies form interval to interval.
i.e.
time, price
4711, 192.30
4713, 192.32
4714, 192.31
4717, 192.34
4718, 192.30
Turned into:
time, price
4711-4715, 192.30
4716-4720, 192.34
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Financial Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!