function y = colcopyi(v,n) % COLCOPYI y = colcopyi(v,n) n columns in reverse order % Version of 8/22/96 % v a row or column vector. % Treats v as column vector, % reverses the order of the % elements, and makes n copies. % Procedure based on "Tony's trick" N = ones(1,n); [r,c] = size(v); if r == 1 v = v(c:-1:1)'; else v = v(r:-1:1); end y = v(:,N);