MatrixBerryCore
cellfunallelem.m
Go to the documentation of this file.
1 function resArr=cellfunallelem(hFunc,inpCell,varargin)
2 nDimVec=cellfun('ndims',inpCell);
3 nDims=max(nDimVec(:));
4 sizeMat=zeros([nDims size(inpCell)]);
5 for iDim=1:nDims
6  sizeMat(iDim,:)=reshape(cellfun('size',inpCell,iDim),1,[]);
7 end
8 %
9 nRealDimMat=sum(sizeMat~=1,1);
10 nRealDims=max(nRealDimMat(:));
11 %
12 for iRealDim=1:nRealDims-1
13  inpCell=cellfun(hFunc,inpCell,'UniformOutput',false);
14 end
15 %
16 resArr=cellfun(hFunc,inpCell,varargin{:});
function cellfunallelem(in hFunc, in inpCell, in varargin)
CELLFUNALLELEM applies the specified function to all elements in each cell of the specified cell arra...