Mercurial > hg > ishara
view general/numerical/array/minmax.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 R=minmax(X,I) % minmax - return minimum and maximum along a particular dimension % % minmax :: [[N,M]], 1:natural -> [[2,M]]. % minmax :: [[N,M]], 2:natural -> [[N,2]]. % minmax :: [D:[[1,E]]], I:[E] -> [set(D,I,2)]. % % The most general type means that the return array is the same size % as the input array except that the size along the Ith dimension % becomes 2, first element is min, second is max. % % The functions is constructed so that it is idemponent: % minmax(X,I) == minmax(minmax(X,I),I) R= cat(I,min(X,[],I),max(X,[],I));