matlab where i must define a function code example Example: function maltab function ave = average(x) ave = sum(x(:))/numel(x); end