function y = mymean(x)
% mymean Average or mean value.
% For vectors, mymean(x) returns the
%mean value. For matrices, mymean(x)
% is a row vector containing the mean
% value of each column.
[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
nargin - number of function input arguments
nargout - number of function output arguments
Command Line Syntax
matlab searches the path for an m-file with the specified
function name