How to create a new data set, from an existing data set, with a different time increment than the original

조회 수: 2 (최근 30일)
Suppose you have a very large x, y data set where "x" is time and "y" is some known value. The time increment for "x" is 0.02 seconds. "y" is known at every 0.02 seconds. I would like to change the time increment to 0.010269 seconds and use the known "y" values to find the new "y" values for the 0.010269 increment based off of a linear interpolation between the known original "y" values.

채택된 답변

jonas
jonas 2018년 8월 22일
편집: jonas 2018년 8월 22일
  1. Convert x to duration array
  2. Build a timetable with x and y
  3. Use retime with timestep set to 0.010269
Provide data if you want code.
As a sidenote: based on the very specific timestep I'm guessing you want to align this time-series with another time-series. If that is the case, then simply use the duration array of the other time-series as input to retime.
  댓글 수: 7
Austin Sowers
Austin Sowers 2018년 8월 22일
It looks like it worked! Thank you so much! I have been trying to do this for a week.
jonas
jonas 2018년 8월 22일
You're welcome! Duration (format), datetime (format) and timetables are extremely convenient when working with time-series.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by