Shifting Sequences Using MATLAB I'm reading the book 
Vinay Ingle, John Proakis - Digital Signal Processing Using MATLAB® (3rd Edition) and I came across a function to shift sequences. Mathematically, 

$$
y(n) = \{x(n-k) \}
$$

if $m = n-k$, then 
$$
y(m+k) = \{ x(m) \}
$$

function [y,n] = sigshift(x,m,k)
n = m + k;
y = x;
end


This function shifts nothing. I've tried to find errata list of the book, but I couldn't find it. Is this function correct?
In order to shift in MATLAB you need to play with the indices of the signal vector.
for example, given vector x - vX of length L, to shift it in time such that the first sample is the fifth you'll do this:

vXShifted = x(5:L);


Pay attention that the signal is shorter by 4 samples.

Now, sometimes, for periodic signals, a cyclic shifting is required which can be done using circshift() function in MATLAB.