Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

function y = mean_val(x,dim)

if nargin==1,
% Determine which dimension SUM will use
dim = find(size(x)~=1, 1 );
if isempty(dim), dim = 1; end
y = sum(x)/size(x,dim);
else
y = (sum(x,dim)/(size(x,dim)*10));
end

You might also like