function varargout=with_columns(f,x,varargin)
	slices=cslices(x,2);
	[varargout{1:nargout}]=f(slices{:},varargin{:});
end

function y=cslices(x,dim)
	if nargin<2, dim=length(size1(x)); end
	y=map(@(i)sli(x,i,dim),num2cell(1:size(x,dim)));
end
