Synchronizing two timetables that contain cell arrays

14 views (last 30 days)
I have two time tables that I am attempting to synchronize using MATLAB 2021b. One of the timetables contains cell variables such that [1 x N] matrices and cell arrays can be placed at a specififc time under these cell variables (see T_Sensors_temp variable in the attached MAT file). When I run the code
T = synchronize(T_temp,T_Sensors_temp);
I get the following error:
Error using timetable/synchronize (line 343)
All variables in input timetables must support missing values (e.g. floating point,
categorical, datetime, duration, or text) when synchronizing using 'default'.
I tried to specify the method with which to fill the remaining elements with a constant instead of a missing data indicator by running the following command:
T = synchronize(T_temp,T_Sensors_temp,"union","fillwithconstant");
But I get the following error.
Error using timetable/synchronize (line 343)
Conversion to cell from double is not possible.
I am not familiar wtih timetables. Can someone please advise on how to sychronize these two tables?
Thank you!

Accepted Answer

Adam Danz
Adam Danz on 11 Sep 2023
Edited: Adam Danz on 11 Sep 2023
synchronize and retime need to know how you'd like those functions to fill in missing data. The method property allows you to specify a general method applied to all variables in the table. Alternatively, you can specify the method used for each table variable by setting the VariableContinuity property of the timetables. The options are to fill in missing values with a missing value indicator, fill in missing values by linearly interpolation, or by duplicating the previous value (see the doc link for details).
Cell arrays do not have a missing value indicator and cannot be interpolated so your option option is to replicate the previous value.
Since all of the table variables in T_Sensorys_temp are cell arrays, you can assign the VariableContinuity values as,
load ExampleTables.mat
T_Sensors_temp.Properties.VariableContinuity = repmat("step",1,width(T_Sensors_temp));
T_temp contains all numeric data which supports any of the VariableContinuity options. To make this demo short, I'll assign missing value indicators as the method but you can replace this with any of the methods and each table variable can have its own definition.
T_temp.Properties.VariableContinuity = repmat("unset",1,width(T_temp));
Now you can proceed to synchronize the tables and the synchronize function will know how you'd like to handle the data.
T = synchronize(T_Sensors_temp, T_temp)
T = 2058×345 timetable
Time Walkway_X Walkway_Y WalkwayPressureLevel WalkwayFoot L Foot Contact R Foot Contact L Foot Pressure R Foot Pressure Sync LowerBack:Acc_X LowerBack:Acc_Y LowerBack:Acc_Z LowerBack:FreeAcc_E LowerBack:FreeAcc_N LowerBack:FreeAcc_U LowerBack:Gyr_X LowerBack:Gyr_Y LowerBack:Gyr_Z LowerBack:Mag_X LowerBack:Mag_Y LowerBack:Mag_Z LowerBack:VelInc_X LowerBack:VelInc_Y LowerBack:VelInc_Z LowerBack:OriInc_q0 LowerBack:OriInc_q1 LowerBack:OriInc_q2 LowerBack:OriInc_q3 LowerBack:Roll LowerBack:Pitch LowerBack:Yaw R_Wrist:Acc_X R_Wrist:Acc_Y R_Wrist:Acc_Z R_Wrist:FreeAcc_E R_Wrist:FreeAcc_N R_Wrist:FreeAcc_U R_Wrist:Gyr_X R_Wrist:Gyr_Y R_Wrist:Gyr_Z R_Wrist:Mag_X R_Wrist:Mag_Y R_Wrist:Mag_Z R_Wrist:VelInc_X R_Wrist:VelInc_Y R_Wrist:VelInc_Z R_Wrist:OriInc_q0 R_Wrist:OriInc_q1 R_Wrist:OriInc_q2 R_Wrist:OriInc_q3 R_Wrist:Roll R_Wrist:Pitch R_Wrist:Yaw L_Wrist:Acc_X L_Wrist:Acc_Y L_Wrist:Acc_Z L_Wrist:FreeAcc_E L_Wrist:FreeAcc_N L_Wrist:FreeAcc_U L_Wrist:Gyr_X L_Wrist:Gyr_Y L_Wrist:Gyr_Z L_Wrist:Mag_X L_Wrist:Mag_Y L_Wrist:Mag_Z L_Wrist:VelInc_X L_Wrist:VelInc_Y L_Wrist:VelInc_Z L_Wrist:OriInc_q0 L_Wrist:OriInc_q1 L_Wrist:OriInc_q2 L_Wrist:OriInc_q3 L_Wrist:Roll L_Wrist:Pitch L_Wrist:Yaw R_MidLatThigh:Acc_X R_MidLatThigh:Acc_Y R_MidLatThigh:Acc_Z R_MidLatThigh:FreeAcc_E R_MidLatThigh:FreeAcc_N R_MidLatThigh:FreeAcc_U R_MidLatThigh:Gyr_X R_MidLatThigh:Gyr_Y R_MidLatThigh:Gyr_Z R_MidLatThigh:Mag_X R_MidLatThigh:Mag_Y R_MidLatThigh:Mag_Z R_MidLatThigh:VelInc_X R_MidLatThigh:VelInc_Y R_MidLatThigh:VelInc_Z R_MidLatThigh:OriInc_q0 R_MidLatThigh:OriInc_q1 R_MidLatThigh:OriInc_q2 R_MidLatThigh:OriInc_q3 R_MidLatThigh:Roll R_MidLatThigh:Pitch R_MidLatThigh:Yaw L_MidLatThigh:Acc_X L_MidLatThigh:Acc_Y L_MidLatThigh:Acc_Z L_MidLatThigh:FreeAcc_E L_MidLatThigh:FreeAcc_N L_MidLatThigh:FreeAcc_U L_MidLatThigh:Gyr_X L_MidLatThigh:Gyr_Y L_MidLatThigh:Gyr_Z L_MidLatThigh:Mag_X L_MidLatThigh:Mag_Y L_MidLatThigh:Mag_Z L_MidLatThigh:VelInc_X L_MidLatThigh:VelInc_Y L_MidLatThigh:VelInc_Z L_MidLatThigh:OriInc_q0 L_MidLatThigh:OriInc_q1 L_MidLatThigh:OriInc_q2 L_MidLatThigh:OriInc_q3 L_MidLatThigh:Roll L_MidLatThigh:Pitch L_MidLatThigh:Yaw R_LatShank:Acc_X R_LatShank:Acc_Y R_LatShank:Acc_Z R_LatShank:FreeAcc_E R_LatShank:FreeAcc_N R_LatShank:FreeAcc_U R_LatShank:Gyr_X R_LatShank:Gyr_Y R_LatShank:Gyr_Z R_LatShank:Mag_X R_LatShank:Mag_Y R_LatShank:Mag_Z R_LatShank:VelInc_X R_LatShank:VelInc_Y R_LatShank:VelInc_Z R_LatShank:OriInc_q0 R_LatShank:OriInc_q1 R_LatShank:OriInc_q2 R_LatShank:OriInc_q3 R_LatShank:Roll R_LatShank:Pitch R_LatShank:Yaw L_LatShank:Acc_X L_LatShank:Acc_Y L_LatShank:Acc_Z L_LatShank:FreeAcc_E L_LatShank:FreeAcc_N L_LatShank:FreeAcc_U L_LatShank:Gyr_X L_LatShank:Gyr_Y L_LatShank:Gyr_Z L_LatShank:Mag_X L_LatShank:Mag_Y L_LatShank:Mag_Z L_LatShank:VelInc_X L_LatShank:VelInc_Y L_LatShank:VelInc_Z L_LatShank:OriInc_q0 L_LatShank:OriInc_q1 L_LatShank:OriInc_q2 L_LatShank:OriInc_q3 L_LatShank:Roll L_LatShank:Pitch L_LatShank:Yaw R_DorsalFoot:Acc_X R_DorsalFoot:Acc_Y R_DorsalFoot:Acc_Z R_DorsalFoot:FreeAcc_E R_DorsalFoot:FreeAcc_N R_DorsalFoot:FreeAcc_U R_DorsalFoot:Gyr_X R_DorsalFoot:Gyr_Y R_DorsalFoot:Gyr_Z R_DorsalFoot:Mag_X R_DorsalFoot:Mag_Y R_DorsalFoot:Mag_Z R_DorsalFoot:VelInc_X R_DorsalFoot:VelInc_Y R_DorsalFoot:VelInc_Z R_DorsalFoot:OriInc_q0 R_DorsalFoot:OriInc_q1 R_DorsalFoot:OriInc_q2 R_DorsalFoot:OriInc_q3 R_DorsalFoot:Roll R_DorsalFoot:Pitch R_DorsalFoot:Yaw L_DorsalFoot:Acc_X L_DorsalFoot:Acc_Y L_DorsalFoot:Acc_Z L_DorsalFoot:FreeAcc_E L_DorsalFoot:FreeAcc_N L_DorsalFoot:FreeAcc_U L_DorsalFoot:Gyr_X L_DorsalFoot:Gyr_Y L_DorsalFoot:Gyr_Z L_DorsalFoot:Mag_X L_DorsalFoot:Mag_Y L_DorsalFoot:Mag_Z L_DorsalFoot:VelInc_X L_DorsalFoot:VelInc_Y L_DorsalFoot:VelInc_Z L_DorsalFoot:OriInc_q0 L_DorsalFoot:OriInc_q1 L_DorsalFoot:OriInc_q2 L_DorsalFoot:OriInc_q3 L_DorsalFoot:Roll L_DorsalFoot:Pitch L_DorsalFoot:Yaw R_Ankle:Acc_X R_Ankle:Acc_Y R_Ankle:Acc_Z R_Ankle:FreeAcc_E R_Ankle:FreeAcc_N R_Ankle:FreeAcc_U R_Ankle:Gyr_X R_Ankle:Gyr_Y R_Ankle:Gyr_Z R_Ankle:Mag_X R_Ankle:Mag_Y R_Ankle:Mag_Z R_Ankle:VelInc_X R_Ankle:VelInc_Y R_Ankle:VelInc_Z R_Ankle:OriInc_q0 R_Ankle:OriInc_q1 R_Ankle:OriInc_q2 R_Ankle:OriInc_q3 R_Ankle:Roll R_Ankle:Pitch R_Ankle:Yaw L_Ankle:Acc_X L_Ankle:Acc_Y L_Ankle:Acc_Z L_Ankle:FreeAcc_E L_Ankle:FreeAcc_N L_Ankle:FreeAcc_U L_Ankle:Gyr_X L_Ankle:Gyr_Y L_Ankle:Gyr_Z L_Ankle:Mag_X L_Ankle:Mag_Y L_Ankle:Mag_Z L_Ankle:VelInc_X L_Ankle:VelInc_Y L_Ankle:VelInc_Z L_Ankle:OriInc_q0 L_Ankle:OriInc_q1 L_Ankle:OriInc_q2 L_Ankle:OriInc_q3 L_Ankle:Roll L_Ankle:Pitch L_Ankle:Yaw Xiphoid:Acc_X Xiphoid:Acc_Y Xiphoid:Acc_Z Xiphoid:FreeAcc_E Xiphoid:FreeAcc_N Xiphoid:FreeAcc_U Xiphoid:Gyr_X Xiphoid:Gyr_Y Xiphoid:Gyr_Z Xiphoid:Mag_X Xiphoid:Mag_Y Xiphoid:Mag_Z Xiphoid:VelInc_X Xiphoid:VelInc_Y Xiphoid:VelInc_Z Xiphoid:OriInc_q0 Xiphoid:OriInc_q1 Xiphoid:OriInc_q2 Xiphoid:OriInc_q3 Xiphoid:Roll Xiphoid:Pitch Xiphoid:Yaw Forehead:Acc_X Forehead:Acc_Y Forehead:Acc_Z Forehead:FreeAcc_E Forehead:FreeAcc_N Forehead:FreeAcc_U Forehead:Gyr_X Forehead:Gyr_Y Forehead:Gyr_Z Forehead:Mag_X Forehead:Mag_Y Forehead:Mag_Z Forehead:VelInc_X Forehead:VelInc_Y Forehead:VelInc_Z Forehead:OriInc_q0 Forehead:OriInc_q1 Forehead:OriInc_q2 Forehead:OriInc_q3 Forehead:Roll Forehead:Pitch Forehead:Yaw LPressure1 LPressure2 LPressure3 LPressure4 LPressure5 LPressure6 LPressure7 LPressure8 LPressure9 LPressure10 LPressure11 LPressure12 LPressure13 LPressure14 LPressure15 LPressure16 Linsole:Acc_X Linsole:Acc_Y Linsole:Acc_Z LAngular_X LAngular_Y LAngular_Z LTotalForce LCoP_X LCoP_Y RPressure1 RPressure2 RPressure3 RPressure4 RPressure5 RPressure6 RPressure7 RPressure8 RPressure9 RPressure10 RPressure11 RPressure12 RPressure13 RPressure14 RPressure15 RPressure16 Rinsole:Acc_X Rinsole:Acc_Y Rinsole:Acc_Z RAngular_X RAngular_Y RAngular_Z RTotalForce RCoP_X RCoP_Y ________ __________________________________________________________________________________________________________________________________________________________________________________________________ ________________________________________________________________________________________________________________________________________________________________________________________________ __________________________________________________________________________________________________________________________________________________________________________________________________ ____________ ______________ ______________ _______________ _______________ ____ _______________ _______________ _______________ ___________________ ___________________ ___________________ _______________ _______________ _______________ _______________ _______________ _______________ __________________ __________________ __________________ ___________________ ___________________ ___________________ ___________________ ______________ _______________ _____________ _____________ _____________ _____________ _________________ _________________ _________________ _____________ _____________ _____________ _____________ _____________ _____________ ________________ ________________ ________________ _________________ _________________ _________________ _________________ ____________ _____________ ___________ _____________ _____________ _____________ _________________ _________________ _________________ _____________ _____________ _____________ _____________ _____________ _____________ ________________ ________________ ________________ _________________ _________________ _________________ _________________ ____________ _____________ ___________ ___________________ ___________________ ___________________ _______________________ _______________________ _______________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ______________________ ______________________ ______________________ _______________________ _______________________ _______________________ _______________________ __________________ ___________________ _________________ ___________________ ___________________ ___________________ _______________________ _______________________ _______________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ______________________ ______________________ ______________________ _______________________ _______________________ _______________________ _______________________ __________________ ___________________ _________________ ________________ ________________ ________________ ____________________ ____________________ ____________________ ________________ ________________ ________________ ________________ ________________ ________________ ___________________ ___________________ ___________________ ____________________ ____________________ ____________________ ____________________ _______________ ________________ ______________ ________________ ________________ ________________ ____________________ ____________________ ____________________ ________________ ________________ ________________ ________________ ________________ ________________ ___________________ ___________________ ___________________ ____________________ ____________________ ____________________ ____________________ _______________ ________________ ______________ __________________ __________________ __________________ ______________________ ______________________ ______________________ __________________ __________________ __________________ __________________ __________________ __________________ _____________________ _____________________ _____________________ ______________________ ______________________ ______________________ ______________________ _________________ __________________ ________________ __________________ __________________ __________________ ______________________ ______________________ ______________________ __________________ __________________ __________________ __________________ __________________ __________________ _____________________ _____________________ _____________________ ______________________ ______________________ ______________________ ______________________ _________________ __________________ ________________ _____________ _____________ _____________ _________________ _________________ _________________ _____________ _____________ _____________ _____________ _____________ _____________ ________________ ________________ ________________ _________________ _________________ _________________ _________________ ____________ _____________ ___________ _____________ _____________ _____________ _________________ _________________ _________________ _____________ _____________ _____________ _____________ _____________ _____________ ________________ ________________ ________________ _________________ _________________ _________________ _________________ ____________ _____________ ___________ _____________ _____________ _____________ _________________ _________________ _________________ _____________ _____________ _____________ _____________ _____________ _____________ ________________ ________________ ________________ _________________ _________________ _________________ _________________ ____________ _____________ ___________ ______________ ______________ ______________ __________________ __________________ __________________ ______________ ______________ ______________ ______________ ______________ ______________ _________________ _________________ _________________ __________________ __________________ __________________ __________________ _____________ ______________ ____________ __________ __________ __________ __________ __________ __________ __________ __________ __________ ___________ ___________ ___________ ___________ ___________ ___________ ___________ _____________ _____________ _____________ __________ __________ __________ ___________ _________ _________ __________ __________ __________ __________ __________ __________ __________ __________ __________ ___________ ___________ ___________ ___________ ___________ ___________ ___________ _____________ _____________ _____________ __________ __________ __________ ___________ _________ ________ 0 sec {[221 222 223 224 225 207 221 222 223 224 225 205 207 220 221 222 223 224 225 226 203 204 205 206 207 208 221 222 223 224 225 226 204 205 206 207 208 221 222 223 224 225 226 227 203 204 205 … ]} {[14 14 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 … ]} {[2 2 2 4 2 2 5 3 2 4 5 3 2 2 3 4 3 5 6 6 2 4 4 3 3 2 4 4 5 6 7 8 4 4 5 4 3 3 5 5 6 7 9 5 2 3 4 5 4 3 5 6 5 7 8 6 3 3 5 5 5 5 6 6 7 4 2 4 6 6 6 5 5 8 9 9 9 4 7 8 9 8 5 6 4 6 7 7 9 3 4 3 3 2 … ]} {1×159 cell} 1 1 133 409 1 9.5558 0.19469 0.10209 0.19063 -0.1507 -0.25749 0.009886 0.029144 -0.001212 -0.85523 -0.60205 -0.090332 0.095558 0.001946 0.001007 1 4.9e-05 0.000146 -6e-06 113.85 -88.161 7.1899 9.2608 -2.3284 0.32097 -0.45296 1.4477 -0.37943 -0.027548 0.079929 0.065196 -0.67383 0.11182 0.37207 0.092617 -0.023253 0.003176 1 -0.000138 0.0004 0.000326 -47.595 -82.557 -134.09 9.6822 2.6397 1.0834 1.1723 -0.40293 0.20482 -0.067738 0.25098 -0.58279 -0.69165 0.29956 -0.271 0.096912 0.026118 0.010703 0.99999 -0.000339 0.001255 -0.002914 42.684 -76.204 -119.76 9.6974 1.0734 -1.0587 -0.044059 0.1276 0.000291 0.12565 0.02731 -0.097434 -0.6062 -0.21289 0.49634 0.096978 0.010693 -0.010594 1 0.000628 0.000137 -0.000487 132.5 -80.432 86.177 9.4914 1.0325 -0.04632 -1.0397 0.36625 -0.32902 -0.1031 -0.066812 0.12852 -0.65454 0.1394 -0.32373 0.094908 0.010386 -0.000437 1 -0.000515 -0.000334 0.000643 -175.53 -87.769 -130.71 9.7687 -0.88169 -0.85265 -0.022107 0.18723 0.030945 0.049843 0.070892 -0.079898 -0.6958 -0.10327 0.48291 0.097681 -0.008854 -0.008563 1 0.000249 0.000354 -0.000399 -142.87 -83.072 0.85767 9.7046 0.26174 0.14732 0.22453 1.0215 -0.15997 -0.021385 -0.076438 -0.03171 -0.71948 0.30762 -0.39307 0.097046 0.002602 0.00151 1 -0.000107 -0.000382 -0.000159 -92.967 -85.457 70.456 6.6751 -2.3068 6.8242 0.012056 0.01825 0.008086 -0.001712 -0.022118 -0.008597 -0.62207 0.2041 -0.22974 0.066742 -0.02307 0.06825 1 -9e-06 -0.000111 -4.3e-05 -18.635 -42.95 -137.3 6.1191 0.85164 7.6405 -0.031696 -0.008719 0.013061 0.002342 0.028255 -0.00856 -0.55102 0.27051 -0.50122 0.061202 0.008513 0.076397 1 1.2e-05 0.000141 -4.3e-05 6.1243 -38.545 95.647 9.8692 -0.546 -0.559 0.009623 0.079226 0.087036 0.020888 0.095598 -0.061999 -0.87964 -0.26172 0.43921 0.098687 -0.00549 -0.005638 1 0.000104 0.000478 -0.00031 -141.33 -85.633 -20.328 9.8018 0.15209 -0.43151 -0.1612 0.27836 -0.005452 0.042868 -0.088803 -0.012697 -0.76977 0.17188 -0.37964 0.09802 0.001516 -0.004271 1 0.000214 -0.000444 -6.3e-05 -159.06 -87.229 -172.06 9.7354 -0.75182 0.47571 -0.058971 -0.17798 -0.03849 -0.071627 0.094032 0.023252 -0.64648 0.46216 0.091553 0.097357 -0.007505 0.004714 1 -0.000358 0.00047 0.000116 -45.822 -85.17 -2.3908 -0.57411 -9.8523 -0.25545 -0.088571 -0.50338 0.046385 0.76753 0.00191 0.13731 0.43262 0.77881 0.034912 -0.005673 -0.098516 -0.002933 0.99999 0.003838 1e-05 0.000687 -88.298 3.5402 -13.132 1.75 1.75 1.75 1 2.75 0.5 0.5 0.25 0 0.5 0 0 0 3.25 2.25 4.5 -0.28809 0.039551 0.95264 -1.61 -1.19 0.07 230 0.023563 -0.026377 6.75 7 5.5 6.5 5.25 7.75 0.75 5.25 0.5 2 1 1 2.25 5.5 1.25 7 -0.27051 0.094238 0.94922 -0.7 -2.31 2.1 796 -0.089211 -0.115 0.01 sec {[221 223 224 225 207 221 222 223 224 225 205 207 221 222 223 224 225 226 203 204 205 206 207 208 221 222 223 224 225 226 203 204 205 206 207 208 221 222 223 224 225 226 227 203 204 205 206 … ]} {[14 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 … ]} {[2 2 3 2 2 5 3 2 3 5 3 2 3 4 3 5 6 5 2 4 4 3 3 2 4 4 5 6 7 8 2 4 4 5 4 3 3 5 5 6 7 9 5 2 3 4 5 4 3 5 6 5 7 8 6 3 4 5 5 5 5 6 6 7 4 2 4 6 6 6 5 5 8 9 9 9 4 7 8 9 8 5 6 4 6 7 7 9 3 4 3 3 2 3 … ]} {1×158 cell} 1 1 135 406 1 9.5158 0.24934 -0.000514 0.088882 -0.089401 -0.29448 0.018048 0.011774 -0.000807 -0.86108 -0.59375 -0.08667 0.095158 0.002493 -1.1e-05 1 9e-05 5.9e-05 -4e-06 113.66 -88.163 7.391 9.2515 -2.1728 0.11507 -0.66829 1.294 -0.42103 0.033772 0.062696 0.075392 -0.67847 0.11963 0.37134 0.092523 -0.021693 0.001118 1 0.000169 0.000313 0.000377 -47.591 -82.499 -134.07 9.7345 2.643 1.0613 1.1241 -0.47467 0.25618 -0.16653 0.23068 -0.60241 -0.69873 0.29956 -0.2727 0.097436 0.026145 0.010479 0.99999 -0.000833 0.001153 -0.003012 43.244 -75.873 -120.44 9.6833 1.2017 -1.0855 0.009108 0.014367 0.005091 0.10117 0.034255 -0.091072 -0.5918 -0.20337 0.49756 0.096837 0.011979 -0.010866 1 0.000506 0.000171 -0.000455 132.27 -80.41 86.467 9.5055 0.96616 -0.070413 -0.98474 0.3477 -0.31523 -0.12377 -0.081207 0.10156 -0.64307 0.14819 -0.32153 0.09505 0.009709 -0.000672 1 -0.000619 -0.000406 0.000508 -174.22 -87.717 -132.09 9.7061 -0.91758 -0.84813 -0.058979 0.21916 -0.029086 0.056601 0.078742 -0.078184 -0.68677 -0.095215 0.48364 0.097054 -0.009211 -0.008522 1 0.000283 0.000394 -0.000391 -142.91 -83.136 0.9306 9.7767 0.18794 0.15992 0.17932 0.96523 -0.082252 -0.055468 -0.081423 -0.007531 -0.70654 0.3147 -0.38867 0.097767 0.001876 0.001638 1 -0.000277 -0.000407 -3.8e-05 -93.569 -85.457 71.025 6.7034 -2.3206 6.8395 0.002485 0.020681 0.04117 0.001122 -0.023252 -0.008978 -0.61035 0.21216 -0.22998 0.067025 -0.023209 0.068402 1 6e-06 -0.000116 -4.5e-05 -18.633 -42.965 -137.3 6.1287 0.84324 7.6615 -0.019764 -0.010026 0.034633 0.00715 0.029238 -0.007189 -0.53857 0.27905 -0.50147 0.061298 0.008427 0.076606 1 3.6e-05 0.000146 -3.6e-05 6.134 -38.53 95.641 9.8173 -0.5679 -0.54638 0.000322 0.1082 0.035637 0.036674 0.092359 -0.067017 -0.88574 -0.25732 0.43994 0.098169 -0.005711 -0.00551 1 0.000183 0.000462 -0.000335 -141.27 -85.697 -20.368 9.871 0.17415 -0.43552 -0.18028 0.2952 0.063405 0.031 -0.097184 0.014081 -0.77295 0.17822 -0.37671 0.098712 0.001749 -0.004307 1 0.000155 -0.000486 7e-05 -159.26 -87.172 -171.85 9.7582 -0.75431 0.50977 -0.073961 -0.15923 -0.013724 -0.058904 0.093729 0.026724 -0.65161 0.46704 0.093018 0.097585 -0.007529 0.005054 1 -0.000295 0.000469 0.000134 -45.508 -85.123 -2.7408 -0.63787 -9.6606 -0.10959 -0.13231 -0.41384 -0.14018 0.7594 0.012693 0.12004 0.42822 0.78516 0.025635 -0.006321 -0.096605 -0.001462 0.99999 0.003797 6.3e-05 0.0006 -87.864 3.6085 -13.133 1.5 1.75 2 0.75 2.75 0.25 0.5 0.25 0 0.75 0 0 0 3.5 2.75 5 -0.29248 0.046387 0.94971 -1.68 -1.19 0 239 0.053287 -0.022432 6.5 7 5.5 6.5 5.25 7.75 0.75 5.25 0.75 1.75 0.75 0.75 2.25 5.25 1.25 7 -0.27197 0.095215 0.94922 -0.7 -2.45 2.17 785 -0.091625 -0.11487 0.02 sec {[221 224 207 221 222 223 224 225 205 207 221 222 223 224 225 226 203 204 205 206 207 208 221 222 223 224 225 226 203 204 205 206 207 208 221 222 223 224 225 226 227 203 204 205 206 207 208 … ]} {[14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 … ]} {[2 3 2 5 3 2 3 5 3 2 3 4 3 5 6 5 2 4 4 3 3 2 4 4 5 6 7 8 2 4 4 5 4 3 3 5 5 6 7 9 5 3 4 4 5 4 2 3 5 5 5 7 8 6 3 4 5 5 5 5 6 6 7 4 2 4 6 6 6 5 5 8 9 9 9 4 7 8 9 8 5 6 4 6 7 7 9 3 4 3 3 2 3 5 … ]} {1×159 cell} 1 1 143 405 1 9.5333 0.26817 -0.077281 0.033986 -0.033093 -0.2754 0.021867 -0.009468 -0.004059 -0.86035 -0.60376 -0.09082 0.095333 0.00268 -0.000768 1 0.000109 -4.7e-05 -2e-05 113.8 -88.158 7.2673 9.3557 -2.0042 0.15094 -0.65338 1.1081 -0.33039 0.09201 0.050772 0.078158 -0.68213 0.11157 0.36841 0.093565 -0.020006 0.001476 1 0.00046 0.000254 0.000391 -47.602 -82.445 -134 9.741 2.5612 1.0176 1.0036 -0.57611 0.24432 -0.27944 0.21684 -0.62123 -0.69995 0.29102 -0.27734 0.0975 0.025323 0.010035 0.99999 -0.001397 0.001084 -0.003106 43.764 -75.539 -121.13 9.6811 1.2438 -1.0834 0.030913 -0.013108 0.007901 0.10107 0.033803 -0.087035 -0.59863 -0.21191 0.50342 0.096815 0.012401 -0.010844 1 0.000505 0.000169 -0.000435 132.05 -80.39 86.746 9.676 0.83755 -0.11427 -0.87074 0.30069 -0.1436 -0.15053 -0.097955 0.070351 -0.64844 0.14477 -0.31348 0.096758 0.008409 -0.001102 1 -0.000753 -0.00049 0.000352 -173.44 -87.656 -132.95 9.7561 -0.85146 -0.92568 -0.084303 0.12039 0.023052 0.066359 0.072008 -0.083971 -0.68872 -0.10156 0.4917 0.097554 -0.008552 -0.009295 1 0.000332 0.00036 -0.00042 -142.99 -83.2 1.0475 9.8002 0.11187 0.16907 0.13588 0.90406 -0.053083 -0.074764 -0.077954 0.013679 -0.71045 0.30908 -0.38281 0.098002 0.001126 0.001729 1 -0.000374 -0.00039 6.8e-05 -94.142 -85.443 71.554 6.6807 -2.2845 6.8714 0.055967 0.009931 0.039425 0.001713 -0.025337 -0.010494 -0.61548 0.21021 -0.22388 0.066797 -0.022849 0.068723 1 9e-06 -0.000127 -5.2e-05 -18.631 -42.981 -137.3 6.1259 0.83874 7.7227 -0.003848 -0.045953 0.080204 0.005887 0.027866 -0.00837 -0.54443 0.271 -0.49536 0.061271 0.008383 0.077219 1 2.9e-05 0.000139 -4.2e-05 6.1435 -38.516 95.634 9.8301 -0.54465 -0.56581 -0.019506 0.083054 0.048382 0.06087 0.069374 -0.068042 -0.88794 -0.26538 0.4353 0.098297 -0.005478 -0.005694 1 0.000304 0.000347 -0.00034 -141.31 -85.751 -20.292 9.8853 0.054591 -0.4842 -0.090215 0.2121 0.081964 0.034733 -0.083066 0.033531 -0.77417 0.17114 -0.37939 0.098855 0.000563 -0.004801 1 0.000174 -0.000415 0.000168 -159.17 -87.118 -171.92 9.8216 -0.73329 0.48289 -0.027356 -0.1705 0.046604 -0.047602 0.09483 0.026342 -0.65381 0.45679 0.092773 0.09822 -0.007319 0.004784 1 -0.000238 0.000474 0.000132 -45.189 -85.075 -3.0896 -0.73768 -9.4493 0.074176 -0.20478 -0.27371 -0.3405 0.74214 0.020937 0.09635 0.43262 0.78101 0.020996 -0.007331 -0.094499 0.000392 0.99999 0.003711 0.000105 0.000482 -87.44 3.6631 -13.14 1.75 1.75 2 1 3 0.5 0.5 0.5 0 0.5 0 0 0 3.75 3 5 -0.29346 0.047852 0.95508 -1.61 -1.26 0 259 0.043062 -0.031815 6.5 7 5.25 6.5 5 7.75 0.5 5.25 0.75 1.75 0.75 1 2.25 5.25 1.25 7 -0.26807 0.086914 0.94434 -0.77 -2.66 2.17 777 -0.090512 -0.11929 0.03 sec {[221 224 207 221 222 223 224 225 205 207 221 222 223 224 225 226 203 204 205 206 207 208 221 222 223 224 225 226 203 204 205 206 207 208 221 222 223 224 225 226 227 203 204 205 206 207 221 … ]} {[14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 20 … ]} {[2 3 2 5 3 2 3 5 3 2 3 4 3 5 6 5 2 4 4 3 3 2 4 4 5 6 7 8 2 4 4 5 4 3 3 5 4 6 7 9 4 3 4 4 5 4 3 5 5 5 7 8 6 3 4 5 5 5 5 6 6 7 4 2 4 6 6 6 5 5 8 9 8 9 4 7 8 9 8 5 6 4 6 7 7 9 3 2 2 4 3 2 2 2 … ]} {1×160 cell} 1 1 143 402 1 9.5635 0.22151 -0.13767 0.044853 0.041552 -0.24587 0.027679 -0.023451 -0.000224 -0.85352 -0.59448 -0.084717 0.095635 0.002215 -0.001365 1 0.000138 -0.000117 -1e-06 114.19 -88.152 6.8905 9.5515 -1.7359 0.36033 -0.47649 0.80922 -0.14353 0.13723 0.04821 0.068839 -0.67334 0.11743 0.3728 0.095522 -0.017328 0.003568 1 0.000686 0.000241 0.000344 -47.566 -82.395 -133.95 9.7489 2.4804 0.97491 0.88296 -0.67761 0.23247 -0.36412 0.20984 -0.63289 -0.6936 0.29321 -0.27368 0.097577 0.024513 0.009602 0.99999 -0.001821 0.001049 -0.003164 44.237 -75.202 -121.84 9.688 1.2685 -1.0526 0.064599 -0.008348 0.014356 0.11786 0.039306 -0.084526 -0.59839 -0.20825 0.49878 0.096884 0.01265 -0.010537 1 0.000589 0.000197 -0.000423 131.84 -80.373 87.032 9.7584 0.63927 -0.19669 -0.67392 0.24339 -0.057638 -0.17568 -0.095942 0.045255 -0.64819 0.14502 -0.31567 0.097584 0.006413 -0.001926 1 -0.000878 -0.00048 0.000226 -173.06 -87.598 -133.43 9.7501 -0.74656 -0.96688 -0.064064 0.013624 0.013383 0.062229 0.074879 -0.083253 -0.68897 -0.10205 0.48608 0.097494 -0.007503 -0.009708 1 0.000311 0.000374 -0.000416 -143.06 -83.264 1.154 9.7829 0.049116 0.053935 0.21169 0.80598 -0.065024 -0.078184 -0.083433 0.026928 -0.71069 0.31128 -0.38696 0.097829 0.000505 0.00058 1 -0.000391 -0.000417 0.000135 -94.749 -85.422 72.114 6.7244 -2.3356 6.8306 -0.018513 0.025244 0.05278 0.000887 -0.026857 -0.011818 -0.61475 0.20996 -0.22754 0.067233 -0.02336 0.068315 1 4e-06 -0.000134 -5.9e-05 -18.629 -42.998 -137.3 6.1333 0.85699 7.6958 -0.02581 -0.024697 0.065414 0.00599 0.021731 -0.006456 -0.5437 0.27441 -0.49805 0.061342 0.008566 0.076952 1 3e-05 0.000109 -3.2e-05 6.1525 -38.506 95.629 9.8519 -0.45843 -0.62998 -0.060634 -0.015776 0.069805 0.056566 0.076312 -0.072191 -0.87915 -0.25879 0.43848 0.098515 -0.004618 -0.006339 1 0.000283 0.000382 -0.000361 -141.34 -85.81 -20.223 9.8715 0.10766 -0.44287 -0.16093 0.23955 0.065065 0.025753 -0.073652 0.063876 -0.76733 0.17749 -0.37671 0.098716 0.001109 -0.004392 1 0.000129 -0.000368 0.000319 -158.74 -87.063 -172.33 9.8643 -0.74671 0.42909 0.009848 -0.22517 0.086569 -0.027716 0.09825 0.024701 -0.64404 0.46533 0.093994 0.098646 -0.007454 0.004244 1 -0.000139 0.000491 0.000124 -44.84 -85.027 -3.4574 -0.80862 -9.4042 0.2084 -0.25323 -0.19314 -0.37692 0.72084 0.020106 0.072564 0.42627 0.78516 0.013916 -0.008052 -0.094051 0.001746 0.99999 0.003604 0.000101 0.000363 -87.028 3.7045 -13.146 1.75 1.75 2 1 3 0.75 0.5 0.5 0 0.75 0 0 0 3.5 2.5 5.5 -0.29346 0.047852 0.95508 -1.61 -1.26 0 260 0.034523 -0.038029 6.5 7 5.25 6.25 4.75 7.75 0.75 5.25 0.25 1.75 0.75 1 2.25 5 1.25 7 -0.26904 0.093262 0.94531 -0.91 -2.52 2.17 765 -0.093734 -0.1225
How can I replace the copied cell values with an empty cell?
I guess this might be a follow-up question. One way to replace the cell values that were copied from the previous value is to find which rows of the synchronized table were not part of the original table and then to replace the cell values with empty cells. This can be trcky the if the synchronized table does not use the same time values as the input table. This could also be tricky if both tables had cell array variables. But in your case, only one of the input tables has cell array variables so we can simply look for cell arrays in the synchronized table.
This line below finds all rows in the synchronized table that were part of the original T_Sensors_temp table that contained the cell arrays.
isOriginal = ismember(T.Time, T_Sensors_temp.Time);
Next, we find all cells variables in the synchronized table
cellVarIdx = find(varfun(@iscell,T,'OutputFormat','uniform'));
Loop through each cell variable and replace the duplicated cell data with an empty cell
for i = cellVarIdx
T{~isOriginal,i} = {{}}; % or maybe you want = {[]}
end
Lastly, examine the results. The synchronized table should indicate empty cell values starting at 11:45 sec.
  3 Comments
Adam Danz
Adam Danz on 11 Sep 2023
I anticipated this question and updated my answer while you were asking it 😀
The second part of my answer shows how to replace the filler cell values with an empty cell array but you could also use {0} instead.

Sign in to comment.

More Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!