Smooth2D

From CCN Wiki
Jump to navigation Jump to search

smooth2D is a MATLAB wrapper function that applies the MATLAB smooth() function individually to each column of a 2D matrix (really, I should extend this to a general SmoothND function). The function can be found, as usual, in the ubfs Scripts/Matlab folder. To apply it to a cell array of 2D matrices (e.g., of time series data), use it within cellfun():

smdtM=cellfun(@(x) smooth2D(x, 'span', 6, 'method', 'rloess'), dtM, 'UniformOutput', false);

Check out the help page for the MATLAB smooth() function for more information on the different smoothing methods.

Note that this functionality appears in the smoothdata MATLAB function included in 2017a and later