home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 3.ddi / DEMOS.DI$ / FPLOTDEM.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  571 b   |  29 lines

  1. %FPLOTDEMO Demonstrate how to plot a function.
  2.  
  3. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  4.  
  5. clf
  6. echo on
  7. clc
  8. %   A function called FPLOT is used to plot a function.
  9.  
  10. %   Consider a function called HUMPS(x) that we've defined in 
  11. %   an M-file on disk,
  12.  
  13. type humps
  14. pause   % Strike any key to continue.
  15.  
  16. %   Let's plot this function on the interval from 0 to 2,
  17.  
  18. fplot('humps',[0,2]);
  19.  
  20. pause   % Strike any key to continue.
  21.  
  22. clc
  23. %   Here are the points chosen by the adaptive strategy.
  24.  
  25. [x,y] = fplot('humps',[0,2]);
  26. plot(x,y,'.')
  27.  
  28. echo off
  29.