MATLAB: Interchange positions in a vector vectors I have a vector let's say y = [1 2 3 4] and I want my next output to be y = [2 3 4 1] and then y = [3 4 1 2]. how can I do that without a for? Best Answer You can use circshifty = [1 2 3 4];y1 = circshift(y, -1);y2 = circshift(y, -2);Result>> y1y1 = 2 3 4 1>> y2y2 = 3 4 1 2
Best Answer