This is my workaround:
function Output = PairArrayArrayfun(Function,Array1,Array2,ArrayDimension,UniformOutput)
CatDimension=max(ndims(Array1),ndims(Array2))+1;
if nargout>0
Output=cellfun(@(Cell)Function(Cell{1},Cell{2}),PackIntoCell(cat(CatDimension,SplitIntoCell(Array1,ArrayDimension),SplitIntoCell(Array2,ArrayDimension)),CatDimension),"UniformOutput",false);
if UniformOutput
Output=cell2mat(varargout);
end
else
cellfun(@(Cell)Function(Cell{1},Cell{2}),PackIntoCell(cat(CatDimension,SplitIntoCell(Array1,ArrayDimension),SplitIntoCell(Array2,ArrayDimension)),CatDimension),"UniformOutput",false);
end
end
In this way the responsibility to judge output is kicked back to the caller. It seems clumsy but may be how the built-in cellfun works.