Try this
Edit
Y1={num2cell(rand(16,107)),num2cell(rand(16,47)),num2cell(rand(16,147))};
Y2={num2cell(rand(16,107)),num2cell(rand(16,47)),num2cell(rand(16,147))};
Y3={num2cell(rand(16,107)),num2cell(rand(16,47)),num2cell(rand(16,147))};
Y4={num2cell(rand(16,107)),num2cell(rand(16,47)),num2cell(rand(16,147))};
Ycell={Y1,Y2,Y3,Y4}
n=numel(Ycell);
m=numel(Ycell{1});
M=cell(n,m);
for p=1:m
for k=1:n
M{k,p}=cell2mat(Ycell{k}{p});
end
[ii,jj]=size(M{k,p});
a=cell2mat(M(1:n,p));
b=reshape(a',jj,ii,[]);
out{p}=nanmean(b,3)';
end
out
Best Answer