Mercurial > hg > ishara
view general/numerical/array/arrshift.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | db7f4afd27c5 |
children |
line wrap: on
line source
function Y=arrshift(O,X) % arrshift - columnwise or rowwise subtraction for arrays % % This SUBTRACTS the first argument (a vector) from each % of the vectors (row or column) in the second argument. % Works in two modes: row vector or column vector mode. % % arrshift :: % [Size] ~'values to subtract', % [[N,M]] ~'array of vectors, array domain is M' % -> [[N,M]] ~'vectors relative to new origin'. % % The first argument is REPMATed up to the size of % the second and then subtracted. % % NB: this used to be called vecshift. vecshift is now % specialised to subtract a COLUMN vector from an array % the same size in the first dimension. This version % retains the generality of the original vecshift. % note: this now works for any pair of arrays where size O % is an integer fraction of size X in any dimension Y=X-repmat_to(O,size(X));