% create a large gaussian kernel k = smoothkern(2000); % convolve with a all-ones vector of equal length tic, ko = convones(k, numel(k)); toc % reference: Elapsed time is 0.024565 seconds. % and now the same with conv tic, koc = conv(k, ones(numel(k), 1)); toc % reference: Elapsed time is 0.240042 seconds.