Why do I get "Requested array exceeds the maximum possible variable size" error when using "retime" function?

When I use the "retime" function to resample data in timetable, I got the following error:
"Requested array exceeds the maximum possible variable size."
What could be the cause of this issue? I'm using the following syntax.
TT2 = retime(TT1,'regular','linear','TimeStep',dt)

 Accepted Answer

TT2 = retime(TT1,'regular',method,'TimeStep',dt)
calculates regularly spaced row times using the time step "dt". The "dt" input argument is a scalar duration or calendar duration, specifying a time step of any size. The row times of TT2 span the range of row times of "TT1". Please follow the link below for more information on the ‘retime’ function:
The generated timetable "TT2" can grow large if "dt" is small and a huge jump appears between two adjacent timestamps in "TT1". One way of testing this is to change "dt" to a larger duration. If the code runs successfully without an error, that means the issue is caused by the reason mentioned above.
Two potential workarounds I will suggest are listed below:
1. In most cases, the huge jump is caused by some corrupted datapoints. Check your data again to remove corrupted datapoints.
2. If all data are guaranteed to be correct, then increase the time duration "dt" to decrease the size of the generated timetable "TT2".

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!