Let's assume your variables are named as 'input01', 'input02', ... 'input48'.
my3Ddata = [];
myMeanData = [];
varnames = whos('input*');
for v = 1:length(varnames)
currInput = eval(varnames(v).name);
currInput(isnan(currInput)) = 0;
my3Ddata = cat(3,my3Ddata,currInput);
currMean = mean(currInput,2);
myMeanData = [myMeanData, currMean];
end
Hope this helps.