recorreder.m - Vector shifting made simple
This uber-simple code is useful to shift a given vector to the right, by N positions. Used for the chain-processing programs by David Valencia (DWT, DWPT, TMX, etc)
More details on the blog post:
http://www.dsprelated.com/showarticle/126.php
function [xd] = recorreder(x,N)
% This function shifts a vector by N positions to the right
% As posted in DSPrelated.com
% http://www.dsprelated.com/showcode/43.php
%
lx = length(x);
if N>lx
fprintf('N has to be smaller than the vector length');
return;
else
xd(N+1:lx) = x(1:lx-N);
end;