Error when using “retime” function MATLAB 2024a.
Hi everyone, I am needing to use the "retime" function on a large timetable data set. I need to retime the data in order to apply filters and process it in MATLAB. The timetable includes the timestamp column and the column of values at each time stamp (cannot post here because of proprietary information). I am trying to retime based on sample rate. Below is the code I am trying to run.
"INV1Spd", "INV1OutTrq", "INVCurrHV" are the timetables I am passing into the command.
"INV1Spd_Ts", "INV1OutTrq_Ts", "INVCurrHV_Ts" are the signal cycle times.
From Main Code:
[INV1Spd_Res, INV1OutTrq_Res, INV1CurrHV_Res] = resample(INV1Spd, INV1Spd_Ts, INV1OutTrq, INV1OutTrq_Ts, INV1CurrHV, INV1CurrHV_Ts);
From Function Script:
INVSpd_Resampled = retime(INVSpd, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVSpd_Ts);
INVOutTrq_Resampled = retime(INVOutTrq, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVOutTrq_Ts);
INVCurrHV_Resampled = retime(INVCurrHV, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVCurrHV_Ts);
Error I get when running code:
Error using timetable/retime (line 142)
Interpolation failed for the variable ‘INV1Spd’ when synchronizing using ‘linear’:
Values V must be of type double or single.
I’m not sure what "Values V" is referencing. I’ve already tried different interpolation methods, I’ve converted the timetables to arrays (which expectedly threw another error), so I am unsure where to go from here. Please ask for any more information needed and I will try to provide. Thanks!Hi everyone, I am needing to use the "retime" function on a large timetable data set. I need to retime the data in order to apply filters and process it in MATLAB. The timetable includes the timestamp column and the column of values at each time stamp (cannot post here because of proprietary information). I am trying to retime based on sample rate. Below is the code I am trying to run.
"INV1Spd", "INV1OutTrq", "INVCurrHV" are the timetables I am passing into the command.
"INV1Spd_Ts", "INV1OutTrq_Ts", "INVCurrHV_Ts" are the signal cycle times.
From Main Code:
[INV1Spd_Res, INV1OutTrq_Res, INV1CurrHV_Res] = resample(INV1Spd, INV1Spd_Ts, INV1OutTrq, INV1OutTrq_Ts, INV1CurrHV, INV1CurrHV_Ts);
From Function Script:
INVSpd_Resampled = retime(INVSpd, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVSpd_Ts);
INVOutTrq_Resampled = retime(INVOutTrq, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVOutTrq_Ts);
INVCurrHV_Resampled = retime(INVCurrHV, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVCurrHV_Ts);
Error I get when running code:
Error using timetable/retime (line 142)
Interpolation failed for the variable ‘INV1Spd’ when synchronizing using ‘linear’:
Values V must be of type double or single.
I’m not sure what "Values V" is referencing. I’ve already tried different interpolation methods, I’ve converted the timetables to arrays (which expectedly threw another error), so I am unsure where to go from here. Please ask for any more information needed and I will try to provide. Thanks! Hi everyone, I am needing to use the "retime" function on a large timetable data set. I need to retime the data in order to apply filters and process it in MATLAB. The timetable includes the timestamp column and the column of values at each time stamp (cannot post here because of proprietary information). I am trying to retime based on sample rate. Below is the code I am trying to run.
"INV1Spd", "INV1OutTrq", "INVCurrHV" are the timetables I am passing into the command.
"INV1Spd_Ts", "INV1OutTrq_Ts", "INVCurrHV_Ts" are the signal cycle times.
From Main Code:
[INV1Spd_Res, INV1OutTrq_Res, INV1CurrHV_Res] = resample(INV1Spd, INV1Spd_Ts, INV1OutTrq, INV1OutTrq_Ts, INV1CurrHV, INV1CurrHV_Ts);
From Function Script:
INVSpd_Resampled = retime(INVSpd, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVSpd_Ts);
INVOutTrq_Resampled = retime(INVOutTrq, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVOutTrq_Ts);
INVCurrHV_Resampled = retime(INVCurrHV, ‘regular’, ‘linear’, ‘SampleRate’, 1/INVCurrHV_Ts);
Error I get when running code:
Error using timetable/retime (line 142)
Interpolation failed for the variable ‘INV1Spd’ when synchronizing using ‘linear’:
Values V must be of type double or single.
I’m not sure what "Values V" is referencing. I’ve already tried different interpolation methods, I’ve converted the timetables to arrays (which expectedly threw another error), so I am unsure where to go from here. Please ask for any more information needed and I will try to provide. Thanks! retime, error, signal processing, synchronization MATLAB Answers — New Questions