annotate general/arrutils/shiftr.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 03694e5c8365
children
rev   line source
samer@13 1 % shiftr - shift array columns right one
samer@13 2 %
samer@13 3 % shiftr :: [[N,M]] -> [[N,M]].
samer@13 4 %
samer@13 5 % Shift array elements right one, padding start with zeros.
samer@13 6 % eg [ 1 2 3 4 ] --> [ 0 1 2 3 ]
samer@4 7 function y=shiftr(x)
samer@13 8 if isvector(x)
samer@13 9 y = [ 0; x(1:end-1) ];
samer@13 10 else
samer@13 11 y = [ zeros(size(x,1),1), x(:,1:size(x,2)-1) ];
samer@13 12 end
samer@13 13 end