annotate sequences/slices.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 9e7be347b3a0
children
rev   line source
samer@23 1 % slices - sequence obtained from slices of an array
samer@23 2 %
samer@23 3 % slices ::
samer@36 4 % [Size(1:E)->A] ~'E-dimensional array',
samer@36 5 % -> seq([Size(1:E-1)->A]).
samer@23 6 %
samer@23 7 % slices ::
samer@36 8 % [Size(1:E)->A] ~'E-dimensional array',
samer@36 9 % D:natural ~'dimension of desired values'
samer@36 10 % -> seq([arrset(Size,D,1)->A]).
samer@23 11 %
samer@23 12 % If 2nd parameter not given, the array is sliced along it's
samer@36 13 % last non-singleton dimension. In the second form, arrset(Size1,D,1)
samer@36 14 % is the same as Size except that element D is set to 1.
samer@23 15
samer@23 16 function y=slices(x,dim),
samer@36 17 if nargin<2, dim=length(size1(x)); end
samer@23 18 if isempty(x), y=nil; else y=seq.slices(x,dim); end
samer@23 19 end