“Nearest neighbor”-like interpolation in MATLAB
问题 This is a small thing but has been bothering me for a while now, so I thought I would let the crowd solving begin :) I have a matrix with timestamps and a corresponding logical value (or 1/0), i.e. of = [-inf 0 10 15 190 inf; 1 0 0 1 1 0]' and an another time vector, e.g. t = 0:0.1:1e3; or whatever, you get the point :) Now how do I (read: would you) inter-/extrapolate the logical infomation in of so it matches the timestamps in t , but with the interpolated logicals always assuming the last