function y=sli(x,i,dim)
% sli - Take a slice of a multidimensional array
%
% sli :: 
%    [Size:[[E]]->A]     ~'E dimensional array of size Size, element type A', 
%    [[M]->1..Size(Dim)] ~'vector of M indices in Dim'th dimension',
%    Dim:1..E            ~'dimension to act along'
% -> [Size2:[[E]]->A]    ~'new array of size Size2 :-
%    Size2=set(Size,Dim,M) ~'new size same as old but with Dim'th entry replaced with M'.

	n=ndims(x);
	idx=repmat({':'},1,n);
	idx{dim}=i;
	y=x(idx{:});
	
