Hello, I have two matrices of different lengths and this is what the scenario looks like ..
x = [...]; y = [...]; size(x) = 5800 * 16 size(y) = 450 * 14 % X & Y have dates & times in the first six columns in this form:
% year, month, day, hour, minute, second
% Each column represents a variable
% Each row represents a data sample
% A model to predict a variable in (X) after some time
... X_time + some_time = predicted_time; % in hours
% "X_time" is the time of (X)
% "Y_time" is the time of (Y)
% Match that predicted time with the time of (Y) within a range of +/- 11 hours
for i = 1:length(x) for j = 1:length(y) if (predicted_time >= Y_time-11) && (Y_time+11 >= predicted_time) is True MATCHED = [x(i,:) y(j,:) predicted_time]; end end end
Please, I want to know how to make this work as I tried a lot but it didn't work properly.
Best Answer