MATLAB: How to take a small array, keyed by a datetime variable which is a subset of a larger array and replace the values in the larger array with the values from the smaller array

MATLABtable operationstimetable operations

What is the best way to take an table which is keyed by a datetime variable and replace the data in a much larger taable (same variables in both) with the data in the smaller table? The smaller table could fall anywhere in the larger table's date range but the smaller table will be made up of contiguous dates.

Best Answer

[isinsmall, where] = ismember(bigtable.datevariable, smalltable.datevariable);
bigtable(isinsmall, :) = smalltable(where, :);
Assuming both tables have the same variable names.