annotate general/with_columns.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
parents |
3cedfd4549ef |
children |
|
rev |
line source |
samer@44
|
1 function varargout=with_columns(f,x,varargin)
|
samer@44
|
2 slices=cslices(x,2);
|
samer@44
|
3 [varargout{1:nargout}]=f(slices{:},varargin{:});
|
samer@44
|
4 end
|
samer@44
|
5
|
samer@44
|
6 function y=cslices(x,dim)
|
samer@44
|
7 if nargin<2, dim=length(size1(x)); end
|
samer@44
|
8 y=map(@(i)sli(x,i,dim),num2cell(1:size(x,dim)));
|
samer@44
|
9 end
|