function y = mymean(x)
%MYMEAN Average or mean value.
% For vectors, MYMEAN(X) is the mean value of the
elements in X. For % matrices, MYMEAN(X)is a row vector
containing the mean value of % each column. For N-D arrays, MYMEAN(X) is the mean
value of the
% elements along the first non-singleton dimension of X.
[m,n]=size(x);
if m==1
m=n;
end
y=sum(x)/m;
Required
Keyword: function
Function name (same as the file name)
File has a *.m extension
Results must be stored in variable(s) with the same name as the
output arguments
Optional
Input/Output Arguments - these define the internal variable names
Online help- comment lines following the function definition line
the lookforcommand uses the first comment line
in its search
Matlab code -contains the matlab expressions to be executed
Command Line Syntax
matlab searches the path for an m-file with the specified
function name