home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / LANG.DI$ / FUNCTION.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  1008 b   |  26 lines

  1. %FUNCTION Function M-files.
  2. %    New functions may be added to MATLAB's vocabulary if they
  3. %     are expressed in terms of other existing functions. The 
  4. %     commands and functions that comprise the new function must
  5. %     be put in a file whose name defines the name of the new 
  6. %     function, with a filename extension of '.m'. At the top of
  7. %    the file must be a line that contains the syntax definition
  8. %    for the new function. For example, the existence of a file 
  9. %    on disk called STAT.M with:
  10. %             function [mean,stdev] = stat(x)
  11. %             n = length(x);
  12. %             mean = sum(x) / n;
  13. %             stdev = sqrt(sum((x - mean).^2)/n);
  14. %     defines a new function called STAT that calculates the 
  15. %     mean and standard deviation of a vector. The variables
  16. %     within the body of the function are all local variables.
  17. %     See SCRIPT for procedures that work globally on the work-
  18. %     space. 
  19. %
  20. %    See also ECHO, SCRIPT.
  21.  
  22. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  23. %    Built-in function.
  24.