e function in matlab code example Example: matlab function function ave = average(x) ave = sum(x(:))/numel(x); end