Clear Filters
Clear Filters

Does a way exists to get the results of the retime function in matlab 2015b??? Any help would be great!!!

3 views (last 30 days)
I'm trying to have one monotonic time created taking the end of the 1st cell of time data and continuing on until the last cell time data as one continous time. the frequency = 0.055;
(e.g. last cell data of cameraTime{1,1} = 3.2969e+03; cameraTime{1,2} = 3.2969e+03 + 0.055 and continue with the size of time data in the remaining cells to create one time for all the total cells.)

Accepted Answer

Walter Roberson
Walter Roberson on 24 Apr 2018
create cell arrays in which the camera time is the first column and the data corresponding to that time is in the other columns. cell2mat() those together into one big matrix and sort() on time.
Create a vector of times from the first to ceil((last-first)/0.055)*0.055+first at intervals of 0.055
Now do interp1() over the arrays, original time values as the x values, vector with consistent offset as the x values to query at.
  9 Comments
Walter Roberson
Walter Roberson on 27 Apr 2018
duration of cycle is 4400. You could use duration objects in this matter, or you could just leave everything numeric. As in
4399.989
4399.9945
0.0
0.0055
going to
4499.989
4399.9945
4400.0
4400.0055
Brandon Leonard
Brandon Leonard on 30 Apr 2018
Thanks Walter for your time. I didn't exactly use your answer but it put me on a path to find a suitable solution. By taking the difference of times (cam{i}) I was able to add the iterations by adding the end number to dt because the first position in column is zero. I will gladly accept your answer because you are a great help!!
dX1 = 0; dt = 0.055
for i = 1:segment
cam{i} = (cameraTime{i}-cameraTime{i}(1));
cam{i} = cam{i} + dX1;
camRT{i} = cam{i};
dX1 = cam{i}(end,1) + dt;

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!