home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fb.zip / octave / doc / octave.i01 (.txt) < prev    next >
GNU Info File  |  2000-01-15  |  50KB  |  1,124 lines

  1. This is Info file octave, produced by Makeinfo-1.64 from the input file
  2. octave.tex.
  3. START-INFO-DIR-ENTRY
  4. * Octave: (octave).    Interactive language for numerical computations.
  5. END-INFO-DIR-ENTRY
  6.    Copyright (C) 1996, 1997 John W. Eaton.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided that
  12. the entire resulting derived work is distributed under the terms of a
  13. permission notice identical to this one.
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions.
  17. File: octave,  Node: Top,  Next: Preface,  Prev: (dir),  Up: (dir)
  18.    This manual documents how to run, install and port GNU Octave, as
  19. well as its new features and incompatibilities, and how to report bugs.
  20. It corresponds to GNU Octave version 2.1.23.
  21. * Menu:
  22. * Preface::
  23. * Introduction::                A brief introduction to Octave.
  24. * Getting Started::
  25. * Data Types::
  26. * Numeric Data Types::
  27. * Strings::
  28. * Data Structures::
  29. * Variables::
  30. * Expressions::                 Expressions.
  31. * Evaluation::
  32. * Statements::                  Looping and program flow control.
  33. * Functions and Scripts::
  34. * Error Handling::
  35. * Input and Output::
  36. * Plotting::
  37. * Matrix Manipulation::
  38. * Arithmetic::
  39. * Linear Algebra::
  40. * Nonlinear Equations::
  41. * Quadrature::
  42. * Differential Equations::
  43. * Optimization::
  44. * Statistics::
  45. * Sets::
  46. * Polynomial Manipulations::
  47. * Control Theory::
  48. * Signal Processing::
  49. * Image Processing::
  50. * Audio Processing::
  51. * System Utilities::
  52. * Tips::
  53. * Trouble::                     If you have trouble installing Octave.
  54. * Installation::                How to configure, compile and install Octave.
  55. * Emacs::
  56. * Grammar::
  57. * Copying::                     The GNU General Public License.
  58. * Concept Index::               An item for each concept.
  59. * Variable Index::              An item for each documented variable.
  60. * Function Index::              An item for each documented function.
  61. * Operator Index::              An item for each documented operator.
  62.  -- The Detailed Node Listing --
  63. Preface
  64. * Acknowledgements::
  65. * How You Can Contribute to Octave::
  66. * Distribution::
  67. A Brief Introduction to Octave
  68. * Running Octave::
  69. * Simple Examples::
  70. * Conventions::
  71. Conventions
  72. * Fonts::
  73. * Evaluation Notation::
  74. * Printing Notation::
  75. * Error Messages::
  76. * Format of Descriptions::
  77. Format of Descriptions
  78. * A Sample Function Description::
  79. * A Sample Command Description::
  80. * A Sample Variable Description::
  81. Getting Started
  82. * Invoking Octave::
  83. * Quitting Octave::
  84. * Getting Help::
  85. * Command Line Editing::
  86. * Errors::
  87. * Executable Octave Programs::
  88. * Comments::
  89. Invoking Octave
  90. * Command Line Options::
  91. * Startup Files::
  92. Command Line Editing
  93. * Cursor Motion::
  94. * Killing and Yanking::
  95. * Commands For Text::
  96. * Commands For Completion::
  97. * Commands For History::
  98. * Customizing the Prompt::
  99. * Diary and Echo Commands::
  100. Data Types
  101. * Built-in Data Types::
  102. * User-defined Data Types::
  103. * Object Sizes::
  104. Built-in Data Types
  105. * Numeric Objects::
  106. * String Objects::
  107. * Data Structure Objects::
  108. Numeric Data Types
  109. * Matrices::
  110. * Ranges::
  111. * Predicates for Numeric Objects::
  112. Matrices
  113. * Empty Matrices::
  114. Strings
  115. * Creating Strings::
  116. * Searching and Replacing::
  117. * String Conversions::
  118. * Character Class Functions::
  119. Variables
  120. * Global Variables::
  121. * Status of Variables::
  122. * Summary of Built-in Variables::
  123. * Defaults from the Environment::
  124. Expressions
  125. * Index Expressions::
  126. * Calling Functions::
  127. * Arithmetic Ops::
  128. * Comparison Ops::
  129. * Boolean Expressions::
  130. * Assignment Ops::
  131. * Increment Ops::
  132. * Operator Precedence::
  133. Calling Functions
  134. * Call by Value::
  135. * Recursion::
  136. Boolean Expressions
  137. * Element-by-element Boolean Operators::
  138. * Short-circuit Boolean Operators::
  139. Statements
  140. * The if Statement::
  141. * The switch Statement::
  142. * The while Statement::
  143. * The for Statement::
  144. * The break Statement::
  145. * The continue Statement::
  146. * The unwind_protect Statement::
  147. * The try Statement::
  148. * Continuation Lines::
  149. The `for' Statement
  150. * Looping Over Structure Elements::
  151. Functions and Script Files
  152. * Defining Functions::
  153. * Multiple Return Values::
  154. * Variable-length Argument Lists::
  155. * Variable-length Return Lists::
  156. * Returning From a Function::
  157. * Function Files::
  158. * Script Files::
  159. * Dynamically Linked Functions::
  160. * Organization of Functions::
  161. Input and Output
  162. * Basic Input and Output::
  163. * C-Style I/O Functions::
  164. Basic Input and Output
  165. * Terminal Output::
  166. * Terminal Input::
  167. * Simple File I/O::
  168. C-Style I/O Functions
  169. * Opening and Closing Files::
  170. * Simple Output::
  171. * Line-Oriented Input::
  172. * Formatted Output::
  173. * Output Conversion for Matrices::
  174. * Output Conversion Syntax::
  175. * Table of Output Conversions::
  176. * Integer Conversions::
  177. * Floating-Point Conversions::  Other Output Conversions::
  178. * Other Output Conversions::
  179. * Formatted Input::
  180. * Input Conversion Syntax::
  181. * Table of Input Conversions::
  182. * Numeric Input Conversions::
  183. * String Input Conversions::
  184. * Binary I/O::
  185. * Temporary Files::
  186. * EOF and Errors::
  187. * File Positioning::
  188. Plotting
  189. * Two-Dimensional Plotting::
  190. * Specialized Two-Dimensional Plots::
  191. * Three-Dimensional Plotting::
  192. * Plot Annotations::
  193. * Multiple Plots on One Page::
  194. Matrix Manipulation
  195. * Finding Elements and Checking Conditions::
  196. * Rearranging Matrices::
  197. * Special Utility Matrices::
  198. * Famous Matrices::
  199. Arithmetic
  200. * Utility Functions::
  201. * Complex Arithmetic::
  202. * Trigonometry::
  203. * Sums and Products::
  204. * Special Functions::
  205. * Mathematical Constants::
  206. Linear Algebra
  207. * Basic Matrix Functions::
  208. * Matrix Factorizations::
  209. * Functions of a Matrix::
  210. Quadrature
  211. * Functions of One Variable::
  212. * Orthogonal Collocation::
  213. Differential Equations
  214. * Ordinary Differential Equations::
  215. * Differential-Algebraic Equations::
  216. Optimization
  217. * Quadratic Programming::
  218. * Nonlinear Programming::
  219. * Linear Least Squares::
  220. Control Theory
  221. * sysstruct::
  222. * sysinterface::
  223. * sysdisp::
  224. * blockdiag::
  225. * numerical::
  226. * sysprop::
  227. * systime::
  228. * sysfreq::
  229. * cacsd::
  230. * misc::
  231. System Data Structure
  232. * sysstructvars::
  233. * sysstructtf::
  234. * sysstructzp::
  235. * sysstructss::
  236. System Construction and Interface Functions
  237. * fir2sys::
  238. * ss2sys::
  239. * tf2sys::
  240. * zp2sys::
  241. * structaccess::
  242. * structintern::
  243. System Utilities
  244. * Timing Utilities::
  245. * Filesystem Utilities::
  246. * Controlling Subprocesses::
  247. * Process ID Information::
  248. * Environment Variables::
  249. * Current Working Directory::
  250. * Password Database Functions::
  251. * Group Database Functions::
  252. * System Information::
  253. Tips and Standards
  254. * Style Tips::                  Writing clean and robust programs.
  255. * Coding Tips::                 Making code run faster.
  256. * Documentation Tips::          Writing readable documentation strings.
  257. * Comment Tips::                Conventions for writing comments.
  258. * Function Headers::            Standard headers for functions.
  259. Known Causes of Trouble with Octave
  260. * Actual Bugs::                 Bugs we will fix later.
  261. * Reporting Bugs::
  262. * Bug Criteria::
  263. * Bug Lists::
  264. * Bug Reporting::
  265. * Sending Patches::
  266. * Service::
  267. Reporting Bugs
  268. * Bug Criteria::
  269. * Where: Bug Lists.             Where to send your bug report.
  270. * Reporting: Bug Reporting.     How to report a bug effectively.
  271. * Patches: Sending Patches.     How to send a patch for Octave.
  272. Installing Octave
  273. * Installation Problems::
  274. * Binary Distributions::
  275. Binary Distributions
  276. * Installing Octave from a Binary Distribution::
  277. * Creating a Binary Distribution::
  278. Emacs Octave Support
  279. * Installing EOS::
  280. * Using Octave Mode::
  281. * Running Octave From Within Emacs::
  282. * Using the Emacs Info Reader for Octave::
  283. Grammar
  284. * Keywords::
  285.     menu
  286.    % DO NOT EDIT!  Generated automatically by munge-texi.
  287. File: octave,  Node: Preface,  Next: Introduction,  Prev: Top,  Up: Top
  288. Preface
  289. *******
  290.    Octave was originally intended to be companion software for an
  291. undergraduate-level textbook on chemical reactor design being written by
  292. James B. Rawlings of the University of Wisconsin-Madison and John G.
  293. Ekerdt of the University of Texas.
  294.    Clearly, Octave is now much more than just another `courseware'
  295. package with limited utility beyond the classroom.  Although our
  296. initial goals were somewhat vague, we knew that we wanted to create
  297. something that would enable students to solve realistic problems, and
  298. that they could use for many things other than chemical reactor design
  299. problems.
  300.    There are those who would say that we should be teaching the students
  301. Fortran instead, because that is the computer language of engineering,
  302. but every time we have tried that, the students have spent far too much
  303. time trying to figure out why their Fortran code crashes and not enough
  304. time learning about chemical engineering.  With Octave, most students
  305. pick up the basics quickly, and are using it confidently in just a few
  306. hours.
  307.    Although it was originally intended to be used to teach reactor
  308. design, it has been used in several other undergraduate and graduate
  309. courses in the Chemical Engineering Department at the University of
  310. Texas, and the math department at the University of Texas has been using
  311. it for teaching differential equations and linear algebra as well.  If
  312. you find it useful, please let us know.  We are always interested to
  313. find out how Octave is being used in other places.
  314.    Virtually everyone thinks that the name Octave has something to do
  315. with music, but it is actually the name of a former professor of mine
  316. who wrote a famous textbook on chemical reaction engineering, and who
  317. was also well known for his ability to do quick `back of the envelope'
  318. calculations.  We hope that this software will make it possible for many
  319. people to do more ambitious computations just as easily.
  320.    Everyone is encouraged to share this software with others under the
  321. terms of the GNU General Public License (*note Copying::.) as described
  322. at the beginning of this manual.  You are also encouraged to help make
  323. Octave more useful by writing and contributing additional functions for
  324. it, and by reporting any problems you may have.
  325. * Menu:
  326. * Acknowledgements::
  327. * How You Can Contribute to Octave::
  328. * Distribution::
  329. File: octave,  Node: Acknowledgements,  Next: How You Can Contribute to Octave,  Prev: Preface,  Up: Preface
  330. Acknowledgements
  331. ================
  332.    Many people have already contributed to Octave's development.  In
  333. addition to John W. Eaton, the following people have helped write parts
  334. of Octave or helped out in various other ways.
  335.    * Thomas Baier (baier@ci.tuwien.ac.at) wrote the original versions
  336.      of `popen', `pclose', `execute', `sync_system', and `async_system'.
  337.    * Karl Berry (karl@cs.umb.edu) wrote the `kpathsea' library that
  338.      allows Octave to recursively search directory paths for function
  339.      and script files.
  340.    * Georg Beyerle (gbeyerle@awi-potsdam.de) contributed code to save
  341.      values in MATLAB's `.mat'-file format, and has provided many
  342.      useful bug reports and suggestions.
  343.    * John Campbell (jcc@bevo.che.wisc.edu) wrote most of the file and
  344.      C-style input and output functions.
  345.    * Brian Fox (bfox@gnu.org) wrote the `readline' library used for
  346.      command history editing, and the portion of this manual that
  347.      documents it.
  348.    * Klaus Gebhardt (gebhardt@crunch.ikp.physik.th-darmstadt.de) ported
  349.      Octave to OS/2.
  350.    * A. Scottedward Hodel (A.S.Hodel@eng.auburn.edu) contributed a
  351.      number of functions including `expm', `qzval', `qzhess', `syl',
  352.      `lyap', and `balance'.
  353.    * Kurt Hornik (Kurt.Hornik@ci.tuwien.ac.at) provided the `corrcoef',
  354.      `cov', `fftconv', `fftfilt', `gcd', `lcd', `kurtosis', `null',
  355.      `orth', `poly', `polyfit', `roots', and `skewness' functions,
  356.      supplied documentation for these and numerous other functions,
  357.      rewrote the Emacs mode for editing Octave code and provided its
  358.      documentation, and has helped tremendously with testing.  He has
  359.      also been a constant source of new ideas for improving Octave.
  360.    * Phil Johnson (johnsonp@nicco.sscnet.ucla.edu) has helped to make
  361.      Linux releases available.
  362.    * Friedrich Leisch (leisch@ci.tuwien.ac.at) provided the
  363.      `mahalanobis' function.
  364.    * Ken Neighbors (wkn@leland.stanford.edu) has provided many useful
  365.      bug reports and comments on MATLAB compatibility.
  366.    * Rick Niles (niles@axp745.gsfc.nasa.gov) rewrote Octave's plotting
  367.      functions to add line styles and the ability to specify an
  368.      unlimited number of lines in a single call.  He also continues to
  369.      track down odd incompatibilities and bugs.
  370.    * Mark Odegard (meo@sugarland.unocal.com) provided the initial
  371.      implementation of `fread', `fwrite', `feof', and `ferror'.
  372.    * Tony Richardson (arichard@stark.cc.oh.us) wrote Octave's image
  373.      processing functions as well as most of the original polynomial
  374.      functions.
  375.    * R. Bruce Tenison (Bruce.Tenison@eng.auburn.edu) wrote the `hess'
  376.      and `schur' functions.
  377.    * Teresa Twaroch (twaroch@ci.tuwien.ac.at) provided the functions
  378.      `gls' and `ols'.
  379.    * Andreas Weingessel (Andreas.Weingessel@ci.tuwien.ac.at) wrote the
  380.      audio functions `lin2mu', `loadaudio', `mu2lin', `playaudio',
  381.      `record', `saveaudio', and `setaudio'.
  382.    * Fook Fah Yap (ffy@eng.cam.ac.uk) provided the `fft' and `ifft'
  383.      functions and valuable bug reports for early versions.
  384.    Special thanks to the following people and organizations for
  385. supporting the development of Octave:
  386.    * Digital Equipment Corporation, for an equipment grant as part of
  387.      their External Research Program.
  388.    * Sun Microsystems, Inc., for an Academic Equipment grant.
  389.    * International Business Machines, Inc., for providing equipment as
  390.      part of a grant to the University of Texas College of Engineering.
  391.    * Texaco Chemical Company, for providing funding to continue the
  392.      development of this software.
  393.    * The University of Texas College of Engineering, for providing a
  394.      Challenge for Excellence Research Supplement, and for providing an
  395.      Academic Development Funds grant.
  396.    * The State of Texas, for providing funding through the Texas
  397.      Advanced Technology Program under Grant No. 003658-078.
  398.    * Noel Bell, Senior Engineer, Texaco Chemical Company, Austin Texas.
  399.    * James B. Rawlings, Professor, University of Wisconsin-Madison,
  400.      Department of Chemical Engineering.
  401.    * Richard Stallman, for writing GNU.
  402.    This project would not have been possible without the GNU software
  403. used in and used to produce Octave.
  404. File: octave,  Node: How You Can Contribute to Octave,  Next: Distribution,  Prev: Acknowledgements,  Up: Preface
  405. How You Can Contribute to Octave
  406. ================================
  407.    There are a number of ways that you can contribute to help make
  408. Octave a better system.  Perhaps the most important way to contribute
  409. is to write high-quality code for solving new problems, and to make
  410. your code freely available for others to use.
  411.    If you find Octave useful, consider providing additional funding to
  412. continue its development.  Even a modest amount of additional funding
  413. could make a significant difference in the amount of time that is
  414. available for development and support.
  415.    If you cannot provide funding or contribute code, you can still help
  416. make Octave better and more reliable by reporting any bugs you find and
  417. by offering suggestions for ways to improve Octave.  *Note Trouble::,
  418. for tips on how to write useful bug reports.
  419. File: octave,  Node: Distribution,  Prev: How You Can Contribute to Octave,  Up: Preface
  420. Distribution
  421. ============
  422.    Octave is "free" software.  This means that everyone is free to use
  423. it and free to redistribute it on certain conditions.  Octave is not in
  424. the public domain.  It is copyrighted and there are restrictions on its
  425. distribution, but the restrictions are designed to ensure that others
  426. will have the same freedom to use and redistribute Octave that you
  427. have.  The precise conditions can be found in the GNU General Public
  428. License that comes with Octave and that also appears in *Note Copying::.
  429.    Octave is available on CD-ROM with various collections of other free
  430. software, and from the Free Software Foundation.  Ordering a copy of
  431. Octave from the Free Software Foundation helps to fund the development
  432. of more free software.  For more information, write to
  433.      Free Software Foundation
  434.      59 Temple Place--Suite 330
  435.      Boston, MA 02111-1307
  436.      USA
  437.    Octave is also available on the Internet from
  438. (ftp://ftp.che.wisc.edu/pub/octave), and additional information is
  439. available from (http://www.che.wisc.edu/octave).
  440.    % DO NOT EDIT!  Generated automatically by munge-texi.
  441. File: octave,  Node: Introduction,  Next: Getting Started,  Prev: Preface,  Up: Top
  442. A Brief Introduction to Octave
  443. ******************************
  444.    This manual documents how to run, install and port GNU Octave, and
  445. how to report bugs.
  446.    GNU Octave is a high-level language, primarily intended for numerical
  447. computations.  It provides a convenient command line interface for
  448. solving linear and nonlinear problems numerically, and for performing
  449. other numerical experiments.  It may also be used as a batch-oriented
  450. language.
  451.    GNU Octave is also freely redistributable software.  You may
  452. redistribute it and/or modify it under the terms of the GNU General
  453. Public License as published by the Free Software Foundation.  The GPL is
  454. included in this manual in *Note Copying::.
  455.    This document corresponds to Octave version 2.1.23.
  456. * Menu:
  457. * Running Octave::
  458. * Simple Examples::
  459. * Conventions::
  460. File: octave,  Node: Running Octave,  Next: Simple Examples,  Prev: Introduction,  Up: Introduction
  461. Running Octave
  462. ==============
  463.    On most systems, the way to invoke Octave is with the shell command
  464. `octave'.  Octave displays an initial message and then a prompt
  465. indicating it is ready to accept input.  You can begin typing Octave
  466. commands immediately afterward.
  467.    If you get into trouble, you can usually interrupt Octave by typing
  468. `Control-C' (usually written `C-c' for short).  `C-c' gets its name
  469. from the fact that you type it by holding down CTRL and then pressing
  470. c.  Doing this will normally return you to Octave's prompt.
  471.    To exit Octave, type `quit', or `exit' at the Octave prompt.
  472.    On systems that support job control, you can suspend Octave by
  473. sending it a `SIGTSTP' signal, usually by typing `C-z'.
  474. File: octave,  Node: Simple Examples,  Next: Conventions,  Prev: Running Octave,  Up: Introduction
  475. Simple Examples
  476. ===============
  477.    The following chapters describe all of Octave's features in detail,
  478. but before doing that, it might be helpful to give a sampling of some
  479. of its capabilities.
  480.    If you are new to Octave, I recommend that you try these examples to
  481. begin learning Octave by using it.  Lines marked with `octave:13>' are
  482. lines you type, ending each with a carriage return.  Octave will
  483. respond with an answer, or by displaying a graph.
  484. Creating a Matrix
  485. -----------------
  486.    To create a new matrix and store it in a variable so that it you can
  487. refer to it later, type the command
  488.      octave:1> a = [ 1, 1, 2; 3, 5, 8; 13, 21, 34 ]
  489. Octave will respond by printing the matrix in neatly aligned columns.
  490. Ending a command with a semicolon tells Octave to not print the result
  491. of a command.  For example
  492.      octave:2> b = rand (3, 2);
  493. will create a 3 row, 2 column matrix with each element set to a random
  494. value between zero and one.
  495.    To display the value of any variable, simply type the name of the
  496. variable.  For example, to display the value stored in the matrix `b',
  497. type the command
  498.      octave:3> b
  499. Matrix Arithmetic
  500. -----------------
  501.    Octave has a convenient operator notation for performing matrix
  502. arithmetic.  For example, to multiply the matrix `a' by a scalar value,
  503. type the command
  504.      octave:4> 2 * a
  505.    To multiply the two matrices `a' and `b', type the command
  506.      octave:5> a * b
  507.    To form the matrix product `transpose (a) * a', type the command
  508.      octave:6> a' * a
  509. Solving Linear Equations
  510. ------------------------
  511.    To solve the set of linear equations `aX = b', use the left division
  512. operator, `\':
  513.      octave:7> a \ b
  514. This is conceptually equivalent to `inv (a) * b', but avoids computing
  515. the inverse of a matrix directly.
  516.    If the coefficient matrix is singular, Octave will print a warning
  517. message and compute a minimum norm solution.
  518. Integrating Differential Equations
  519. ----------------------------------
  520.    Octave has built-in functions for solving nonlinear differential
  521. equations of the form
  522.      dx
  523.      -- = f (x, t)
  524.      dt
  525. with the initial condition
  526.      x(t = t0) = x0
  527. For Octave to integrate equations of this form, you must first provide a
  528. definition of the function `f(x,t)'.  This is straightforward, and may
  529. be accomplished by entering the function body directly on the command
  530. line.  For example, the following commands define the right hand side
  531. function for an interesting pair of nonlinear differential equations.
  532. Note that while you are entering a function, Octave responds with a
  533. different prompt, to indicate that it is waiting for you to complete
  534. your input.
  535.      octave:8> function xdot = f (x, t)
  536.      >
  537.      >  r = 0.25;
  538.      >  k = 1.4;
  539.      >  a = 1.5;
  540.      >  b = 0.16;
  541.      >  c = 0.9;
  542.      >  d = 0.8;
  543.      >
  544.      >  xdot(1) = r*x(1)*(1 - x(1)/k) - a*x(1)*x(2)/(1 + b*x(1));
  545.      >  xdot(2) = c*a*x(1)*x(2)/(1 + b*x(1)) - d*x(2);
  546.      >
  547.      > endfunction
  548. Given the initial condition
  549.      x0 = [1; 2];
  550. and the set of output times as a column vector (note that the first
  551. output time corresponds to the initial condition given above)
  552.      t = linspace (0, 50, 200)';
  553. it is easy to integrate the set of differential equations:
  554.      x = lsode ("f", x0, t);
  555. The function `lsode' uses the Livermore Solver for Ordinary
  556. Differential Equations, described in A. C. Hindmarsh, `ODEPACK, a
  557. Systematized Collection of ODE Solvers', in: Scientific Computing, R. S.
  558. Stepleman et al. (Eds.), North-Holland, Amsterdam, 1983, pages 55-64.
  559. Producing Graphical Output
  560. --------------------------
  561.    To display the solution of the previous example graphically, use the
  562. command
  563.      plot (t, x)
  564.    If you are using the X Window System, Octave will automatically
  565. create a separate window to display the plot.  If you are using a
  566. terminal that supports some other graphics commands, you will need to
  567. tell Octave what kind of terminal you have.  Type the command
  568.      gset term
  569. to see a list of the supported terminal types.  Octave uses `gnuplot'
  570. to display graphics, and can display graphics on any terminal that is
  571. supported by `gnuplot'.
  572.    To capture the output of the plot command in a file rather than
  573. sending the output directly to your terminal, you can use a set of
  574. commands like this
  575.      gset term postscript
  576.      gset output "foo.ps"
  577.      replot
  578. This will work for other types of output devices as well.  Octave's
  579. `gset' command is really just piped to the `gnuplot' subprocess, so
  580. that once you have a plot on the screen that you like, you should be
  581. able to do something like this to create an output file suitable for
  582. your graphics printer.
  583.    Or, you can eliminate the intermediate file by using commands like
  584.      gset term postscript
  585.      gset output "|lpr -Pname_of_your_graphics_printer"
  586.      replot
  587. Editing What You Have Typed
  588. ---------------------------
  589.    At the Octave prompt, you can recall, edit, and reissue previous
  590. commands using Emacs- or vi-style editing commands.  The default
  591. keybindings use Emacs-style commands.  For example, to recall the
  592. previous command, type `Control-p' (usually written `C-p' for short).
  593. `C-p' gets its name from the fact that you type it by holding down CTRL
  594. and then pressing p.  Doing this will normally bring back the previous
  595. line of input.  `C-n' will bring up the next line of input, `C-b' will
  596. move the cursor backward on the line, `C-f' will move the cursor
  597. forward on the line, etc.
  598.    A complete description of the command line editing capability is
  599. given in this manual in *Note Command Line Editing::.
  600. Getting Help
  601. ------------
  602.    Octave has an extensive help facility.  The same documentation that
  603. is available in printed form is also available from the Octave prompt,
  604. because both forms of the documentation are created from the same input
  605. file.
  606.    In order to get good help you first need to know the name of the
  607. command that you want to use.  This name of the function may not always
  608. be obvious, but a good place to start is to just type `help'.  This
  609. will show you all the operators, reserved words, functions, built-in
  610. variables, and function files.  You can then get more help on anything
  611. that is listed by simply including the name as an argument to help.
  612. For example,
  613.      help plot
  614. will display the help text for the `plot' function.
  615.    Octave sends output that is too long to fit on one screen through a
  616. pager like `less' or `more'.  Type a RET to advance one line, a SPC to
  617. advance one page, and q to exit the pager.
  618.    The part of Octave's help facility that allows you to read the
  619. complete text of the printed manual from within Octave normally uses a
  620. separate program called Info.  When you invoke Info you will be put
  621. into a menu driven program that contains the entire Octave manual.
  622. Help for using Info is provided in this manual in *Note Getting Help::.
  623. File: octave,  Node: Conventions,  Prev: Simple Examples,  Up: Introduction
  624. Conventions
  625. ===========
  626.    This section explains the notational conventions that are used in
  627. this manual.  You may want to skip this section and refer back to it
  628. later.
  629. * Menu:
  630. * Fonts::
  631. * Evaluation Notation::
  632. * Printing Notation::
  633. * Error Messages::
  634. * Format of Descriptions::
  635. File: octave,  Node: Fonts,  Next: Evaluation Notation,  Prev: Conventions,  Up: Conventions
  636. Fonts
  637. -----
  638.    Examples of Octave code appear in this font or form: `svd (a)'.
  639. Names that represent arguments or metasyntactic variables appear in
  640. this font or form: FIRST-NUMBER.  Commands that you type at the shell
  641. prompt sometimes appear in this font or form: `octave --no-init-file'.
  642. Commands that you type at the Octave prompt sometimes appear in this
  643. font or form: `foo --bar --baz'.  Specific keys on your keyboard appear
  644. in this font or form: ANY.
  645. File: octave,  Node: Evaluation Notation,  Next: Printing Notation,  Prev: Fonts,  Up: Conventions
  646. Evaluation Notation
  647. -------------------
  648.    In the examples in this manual, results from expressions that you
  649. evaluate are indicated with `=>'.  For example,
  650.      sqrt (2)
  651.           => 1.4142
  652. You can read this as "`sqrt (2)' evaluates to 1.4142".
  653.    In some cases, matrix values that are returned by expressions are
  654. displayed like this
  655.      [1, 2; 3, 4] == [1, 3; 2, 4]
  656.           => [ 1, 0; 0, 1 ]
  657. and in other cases, they are displayed like this
  658.      eye (3)
  659.           =>  1  0  0
  660.               0  1  0
  661.               0  0  1
  662. in order to clearly show the structure of the result.
  663.    Sometimes to help describe one expression, another expression is
  664. shown that produces identical results.  The exact equivalence of
  665. expressions is indicated with `=='.  For example,
  666.      rot90 ([1, 2; 3, 4], -1)
  667.      ==
  668.      rot90 ([1, 2; 3, 4], 3)
  669.      ==
  670.      rot90 ([1, 2; 3, 4], 7)
  671. File: octave,  Node: Printing Notation,  Next: Error Messages,  Prev: Evaluation Notation,  Up: Conventions
  672. Printing Notation
  673. -----------------
  674.    Many of the examples in this manual print text when they are
  675. evaluated.  Examples in this manual indicate printed text with `-|'.
  676. The value that is returned by evaluating the expression (here `1') is
  677. displayed with `=>' and follows on a separate line.
  678.      printf ("foo %s\n", "bar")
  679.           -| foo bar
  680.           => 1
  681. File: octave,  Node: Error Messages,  Next: Format of Descriptions,  Prev: Printing Notation,  Up: Conventions
  682. Error Messages
  683. --------------
  684.    Some examples signal errors.  This normally displays an error message
  685. on your terminal.  Error messages are shown on a line starting with
  686. `error:'.
  687.      struct_elements ([1, 2; 3, 4])
  688.      error: struct_elements: wrong type argument `matrix'
  689. File: octave,  Node: Format of Descriptions,  Prev: Error Messages,  Up: Conventions
  690. Format of Descriptions
  691. ----------------------
  692.    Functions, commands, and variables are described in this manual in a
  693. uniform format.  The first line of a description contains the name of
  694. the item followed by its arguments, if any.  The category--function,
  695. variable, or whatever--appears at the beginning of the line.  The
  696. description follows on succeeding lines, sometimes with examples.
  697. * Menu:
  698. * A Sample Function Description::
  699. * A Sample Command Description::
  700. * A Sample Variable Description::
  701. File: octave,  Node: A Sample Function Description,  Next: A Sample Command Description,  Prev: Format of Descriptions,  Up: Format of Descriptions
  702. A Sample Function Description
  703. .............................
  704.    In a function description, the name of the function being described
  705. appears first.  It is followed on the same line by a list of parameters.
  706. The names used for the parameters are also used in the body of the
  707. description.
  708.    Here is a description of an imaginary function `foo':
  709.  - Function:  foo (X, Y, ...)
  710.      The function `foo' subtracts X from Y, then adds the remaining
  711.      arguments to the result.  If Y is not supplied, then the number 19
  712.      is used by default.
  713.           foo (1, [3, 5], 3, 9)
  714.                => [ 14, 16 ]
  715.           foo (5)
  716.                => 14
  717.      More generally,
  718.           foo (W, X, Y, ...)
  719.           ==
  720.           X - W + Y + ...
  721.    Any parameter whose name contains the name of a type (e.g., INTEGER,
  722. INTEGER1 or MATRIX) is expected to be of that type.  Parameters named
  723. OBJECT may be of any type.  Parameters with other sorts of names (e.g.,
  724. NEW_FILE) are discussed specifically in the description of the
  725. function.  In some sections, features common to parameters of several
  726. functions are described at the beginning.
  727.    Functions in Octave may be defined in several different ways.  The
  728. catagory name for functions may include another name that indicates the
  729. way that the function is defined.  These additional tags include
  730. Built-in Function
  731.      The function described is written in a language like C++, C, or
  732.      Fortran, and is part of the compiled Octave binary.
  733. Loadable Function
  734.      The function described is written in a language like C++, C, or
  735.      Fortran.  On systems that support dynamic linking of user-supplied
  736.      functions, it may be automatically linked while Octave is running,
  737.      but only if it is needed.  *Note Dynamically Linked Functions::.
  738. Function File
  739.      The function described is defined using Octave commands stored in
  740.      a text file.  *Note Function Files::.
  741. Mapping Function
  742.      The function described works element-by-element for matrix and
  743.      vector arguments.
  744. File: octave,  Node: A Sample Command Description,  Next: A Sample Variable Description,  Prev: A Sample Function Description,  Up: Format of Descriptions
  745. A Sample Command Description
  746. ............................
  747.    Command descriptions have a format similar to function descriptions,
  748. except that the word `Function' is replaced by `Command.  Commands are
  749. functions that may called without surrounding their arguments in
  750. parentheses.  For example, here is the description for Octave's `cd'
  751. command:
  752.  - Command: cd DIR
  753.  - Command: chdir DIR
  754.      Change the current working directory to DIR.  For example, `cd
  755.      ~/octave' changes the current working directory to `~/octave'.  If
  756.      the directory does not exist, an error message is printed and the
  757.      working directory is not changed.
  758. File: octave,  Node: A Sample Variable Description,  Prev: A Sample Command Description,  Up: Format of Descriptions
  759. A Sample Variable Description
  760. .............................
  761.    A "variable" is a name that can hold a value.  Although any variable
  762. can be set by the user, "built-in variables" typically exist
  763. specifically so that users can change them to alter the way Octave
  764. behaves (built-in variables are also sometimes called "user options").
  765. Ordinary variables and built-in variables are described using a format
  766. like that for functions except that there are no arguments.
  767.    Here is a description of the imaginary variable
  768. `do_what_i_mean_not_what_i_say'.
  769.  - Built-in Variable: do_what_i_mean_not_what_i_say
  770.      If the value of this variable is nonzero, Octave will do what you
  771.      actually wanted, even if you have typed a completely different and
  772.      meaningless list of commands.
  773.    Other variable descriptions have the same format, but `Built-in
  774. Variable' is replaced by `Variable', for ordinary variables, or
  775. `Constant' for symbolic constants whose values cannot be changed.
  776.    % DO NOT EDIT!  Generated automatically by munge-texi.
  777. File: octave,  Node: Getting Started,  Next: Data Types,  Prev: Introduction,  Up: Top
  778. Getting Started
  779. ***************
  780.    This chapter explains some of Octave's basic features, including how
  781. to start an Octave session, get help at the command prompt, edit the
  782. command line, and write Octave programs that can be executed as commands
  783. from your shell.
  784. * Menu:
  785. * Invoking Octave::
  786. * Quitting Octave::
  787. * Getting Help::
  788. * Command Line Editing::
  789. * Errors::
  790. * Executable Octave Programs::
  791. * Comments::
  792. File: octave,  Node: Invoking Octave,  Next: Quitting Octave,  Prev: Getting Started,  Up: Getting Started
  793. Invoking Octave
  794. ===============
  795.    Normally, Octave is used interactively by running the program
  796. `octave' without any arguments.  Once started, Octave reads commands
  797. from the terminal until you tell it to exit.
  798.    You can also specify the name of a file on the command line, and
  799. Octave will read and execute the commands from the named file and then
  800. exit when it is finished.
  801.    You can further control how Octave starts by using the command-line
  802. options described in the next section, and Octave itself can remind you
  803. of the options available.  Type `octave --help' to display all
  804. available options and briefly describe their use (`octave -h' is a
  805. shorter equivalent).
  806. * Menu:
  807. * Command Line Options::
  808. * Startup Files::
  809. File: octave,  Node: Command Line Options,  Next: Startup Files,  Prev: Invoking Octave,  Up: Invoking Octave
  810. Command Line Options
  811. --------------------
  812.    Here is a complete list of all the command line options that Octave
  813. accepts.
  814. `--debug'
  815.      Enter parser debugging mode.  Using this option will cause Octave's
  816.      parser to print a lot of information about the commands it reads,
  817.      and is probably only useful if you are actually trying to debug
  818.      the parser.
  819. `--echo-commands'
  820.      Echo commands as they are executed.
  821. `--exec-path PATH'
  822.      Specify the path to search for programs to run.  The value of PATH
  823.      specified on the command line will override any value of
  824.      `OCTAVE_EXEC_PATH' found in the environment, but not any commands
  825.      in the system or user startup files that set the built-in variable
  826.      `EXEC_PATH'.
  827. `--help'
  828.      Print short help message and exit.
  829. `--info-file FILENAME'
  830.      Specify the name of the info file to use.  The value of FILENAME
  831.      specified on the command line will override any value of
  832.      `OCTAVE_INFO_FILE' found in the environment, but not any commands
  833.      in the system or user startup files that set the built-in variable
  834.      `INFO_FILE'.
  835. `--info-program PROGRAM'
  836.      Specify the name of the info program to use.  The value of PROGRAM
  837.      specified on the command line will override any value of
  838.      `OCTAVE_INFO_PROGRAM' found in the environment, but not any
  839.      commands in the system or user startup files that set the built-in
  840.      variable `INFO_PROGRAM'.
  841. `--interactive'
  842.      Force interactive behavior.  This can be useful for running Octave
  843.      via a remote shell command or inside an Emacs shell buffer.  For
  844.      another way to run Octave within Emacs, see *Note Emacs::.
  845. `--no-init-file'
  846.      Don't read the `~/.octaverc' or `.octaverc' files.
  847. `--no-line-editing'
  848.      Disable command-line editing.
  849. `--no-site-file'
  850.      Don't read the site-wide `octaverc' file.
  851. `--norc'
  852.      Don't read any of the system or user initialization files at
  853.      startup.  This is equivalent to using both of the options
  854.      `--no-init-file' and `--no-site-file'.
  855. `--path PATH'
  856. `-p PATH'
  857.      Specify the path to search for function files.  The value of PATH
  858.      specified on the command line will override any value of
  859.      `OCTAVE_PATH' found in the environment, but not any commands in the
  860.      system or user startup files that set the built-in variable
  861.      `LOADPATH'.
  862. `--silent'
  863. `--quiet'
  864.      Don't print the usual greeting and version message at startup.
  865. `--traditional'
  866. `--braindead'
  867.      Set initial values for user-preference variables to the following
  868.      values for compatibility with MATLAB.
  869.           PS1                           = ">> "
  870.           PS2                           = ""
  871.           beep_on_error                 = 1
  872.           default_save_format           = "mat-binary"
  873.           define_all_return_values      = 1
  874.           do_fortran_indexing           = 1
  875.           crash_dumps_octave_core       = 0
  876.           empty_list_elements_ok        = 1
  877.           implicit_str_to_num_ok        = 1
  878.           ok_to_lose_imaginary_part     = 1
  879.           page_screen_output            = 0
  880.           prefer_column_vectors         = 0
  881.           print_empty_dimensions        = 0
  882.           treat_neg_dim_as_zero         = 1
  883.           warn_function_name_clash      = 0
  884.           whitespace_in_literal_matrix  = "traditional"
  885. `--verbose'
  886.      Turn on verbose output.
  887. `--version'
  888.      Print the program version number and exit.
  889. `FILE'
  890.      Execute commands from FILE.
  891.    Octave also includes several built-in variables that contain
  892. information about the command line, including the number of arguments
  893. and all of the options.
  894.  - Built-in Variable: argv
  895.      The command line arguments passed to Octave are available in this
  896.      variable.  For example, if you invoked Octave using the command
  897.           octave --no-line-editing --silent
  898.      `argv' would be a list of strings with the elements
  899.      `--no-line-editing' and `--silent'.
  900.      If you write an executable Octave script, `argv' will contain the
  901.      list of arguments passed to the script.  *note Executable Octave
  902.      Programs::..
  903.  - Built-in Variable: program_invocation_name
  904.  - Built-in Variable: program_name
  905.      When Octave starts, the value of the built-in variable
  906.      `program_invocation_name' is automatically set to the name that was
  907.      typed at the shell prompt to run Octave, and the value of
  908.      `program_name' is automatically set to the final component of
  909.      `program_invocation_name'.  For example, if you typed
  910.      `/bin/octave' to start Octave, `program_invocation_name' would
  911.      have the value `"/bin/octave"', and `program_name' would have the
  912.      value `"octave"'.
  913.      If executing a script from the command line (e.g., `octave foo.m')
  914.      or using an executable Octave script, the program name is set to
  915.      the name of the script.  *Note Executable Octave Programs:: for an
  916.      example of how to create an executable Octave script.
  917.    Here is an example of using these variables to reproduce Octave's
  918. command line.
  919.      printf ("%s", program_name);
  920.      for i = 1:nargin
  921.        printf (" %s", argv(i));
  922.      endfor
  923.      printf ("\n");
  924. *Note Index Expressions:: for an explanation of how to properly index
  925. arrays of strings and substrings in Octave, and *Note Defining
  926. Functions:: for information about the variable `nargin'.
  927. File: octave,  Node: Startup Files,  Prev: Command Line Options,  Up: Invoking Octave
  928. Startup Files
  929. -------------
  930.    When Octave starts, it looks for commands to execute from the
  931. following files:
  932. `OCTAVE-HOME/share/octave/site/m/startup/octaverc'
  933.      Where OCTAVE-HOME is the directory in which all of Octave is
  934.      installed (the default is `').  This file is provided so that
  935.      changes to the default Octave environment can be made globally for
  936.      all users at your site for all versions of Octave you have
  937.      installed.  Some care should be taken when making changes to this
  938.      file, since all users of Octave at your site will be affected.
  939. `OCTAVE-HOME/share/octave/VERSION/m/startup/octaverc'
  940.      Where OCTAVE-HOME is the directory in which all of Octave is
  941.      installed (the default is `'), and VERSION is the version number
  942.      of Octave.  This file is provided so that changes to the default
  943.      Octave environment can be made globally for all users for a
  944.      particular version of Octave.  Some care should be taken when
  945.      making changes to this file, since all users of Octave at your
  946.      site will be affected.
  947. `~/.octaverc'
  948.      This file is normally used to make personal changes to the default
  949.      Octave environment.
  950. `.octaverc'
  951.      This file can be used to make changes to the default Octave
  952.      environment for a particular project.  Octave searches for this
  953.      file in the current directory after it reads `~/.octaverc'.  Any
  954.      use of the `cd' command in the `~/.octaverc' file will affect the
  955.      directory that Octave searches for the file `.octaverc'.
  956.      If you start Octave in your home directory, commands from from the
  957.      file `~/.octaverc' will only be executed once.
  958.    A message will be displayed as each of the startup files is read if
  959. you invoke Octave with the `--verbose' option but without the
  960. `--silent' option.
  961.    Startup files may contain any valid Octave commands, including
  962. function definitions.
  963. File: octave,  Node: Quitting Octave,  Next: Getting Help,  Prev: Invoking Octave,  Up: Getting Started
  964. Quitting Octave
  965. ===============
  966.  - Built-in Function:  exit (STATUS)
  967.  - Built-in Function:  quit (STATUS)
  968.      Exit the current Octave session.  If the optional integer value
  969.      STATUS is supplied, pass that value to the operating system as the
  970.      Octave's exit status.
  971.  - Built-in Function:  atexit (FCN)
  972.      Register a function to be called when Octave exits.  For example,
  973.           function print_flops_at_exit ()
  974.             printf ("\n%s\n", system ("fortune"));
  975.             fflush (stdout);
  976.           endfunction
  977.           atexit ("print_flops_at_exit");
  978.      will print a message when Octave exits.
  979. File: octave,  Node: Getting Help,  Next: Command Line Editing,  Prev: Quitting Octave,  Up: Getting Started
  980. Commands for Getting Help
  981. =========================
  982.    The entire text of this manual is available from the Octave prompt
  983. via the command `help -i'.  In addition, the documentation for
  984. individual user-written functions and variables is also available via
  985. the `help' command.  This section describes the commands used for
  986. reading the manual and the documentation strings for user-supplied
  987. functions and variables.  *Note Function Files::, for more information
  988. about how to document the functions you write.
  989.  - Command: help
  990.      Octave's `help' command can be used to print brief usage-style
  991.      messages, or to display information directly from an on-line
  992.      version of the printed manual, using the GNU Info browser.  If
  993.      invoked without any arguments, `help' prints a list of all the
  994.      available operators, functions, and built-in variables.  If the
  995.      first argument is `-i', the `help' command searches the index of
  996.      the on-line version of this manual for the given topics.
  997.      For example, the command `help help' prints a short message
  998.      describing the `help' command, and `help -i help' starts the GNU
  999.      Info browser at this node in the on-line version of the manual.
  1000.      Once the GNU Info browser is running, help for using it is
  1001.      available using the command `C-h'.
  1002.    The help command can give you information about operators, but not
  1003. the comma and semicolons that are used as command separators.  To get
  1004. help for those, you must type `help comma' or `help semicolon'.
  1005.  - Built-in Variable: INFO_FILE
  1006.      The variable `INFO_FILE' names the location of the Octave info
  1007.      file.  The default value is `"OCTAVE-HOME/info/octave.info"', where
  1008.      OCTAVE-HOME is the directory where all of Octave is installed.
  1009.  - Built-in Variable: INFO_FILE
  1010.      The variable `INFO_FILE' names the location of the Octave info
  1011.      file.  The default value is `"OCTAVE-HOME/info/octave.info"', where
  1012.      OCTAVE-HOME is the directory where all of Octave is installed.
  1013.  - Built-in Variable: suppress_verbose_help_message
  1014.      If the value of `suppress_verbose_help_message' is nonzero, Octave
  1015.      will not add additional help information to the end of the output
  1016.      from the `help' command and usage messages for built-in commands.
  1017. File: octave,  Node: Command Line Editing,  Next: Errors,  Prev: Getting Help,  Up: Getting Started
  1018. Command Line Editing
  1019. ====================
  1020.    Octave uses the GNU readline library to provide an extensive set of
  1021. command-line editing and history features.  Only the most common
  1022. features are described in this manual.  Please see The GNU Readline
  1023. Library manual for more information.
  1024.    To insert printing characters (letters, digits, symbols, etc.),
  1025. simply type the character.  Octave will insert the character at the
  1026. cursor and advance the cursor forward.
  1027.    Many of the command-line editing functions operate using control
  1028. characters.  For example, the character `Control-a' moves the cursor to
  1029. the beginning of the line.  To type `C-a', hold down CTRL and then
  1030. press a.  In the following sections, control characters such as
  1031. `Control-a' are written as `C-a'.
  1032.    Another set of command-line editing functions use Meta characters.
  1033. On some terminals, you type `M-u' by holding down META and pressing u.
  1034. If your terminal does not have a META key, you can still type Meta
  1035. charcters using two-character sequences starting with `ESC'.  Thus, to
  1036. enter `M-u', you could type ESCu.  The `ESC' character sequences are
  1037. also allowed on terminals with real Meta keys.  In the following
  1038. sections, Meta characters such as `Meta-u' are written as `M-u'.
  1039. * Menu:
  1040. * Cursor Motion::
  1041. * Killing and Yanking::
  1042. * Commands For Text::
  1043. * Commands For Completion::
  1044. * Commands For History::
  1045. * Customizing the Prompt::
  1046. * Diary and Echo Commands::
  1047. File: octave,  Node: Cursor Motion,  Next: Killing and Yanking,  Prev: Command Line Editing,  Up: Command Line Editing
  1048. Cursor Motion
  1049. -------------
  1050.    The following commands allow you to position the cursor.
  1051. `C-b'
  1052.      Move back one character.
  1053. `C-f'
  1054.      Move forward one character.
  1055. `DEL'
  1056.      Delete the character to the left of the cursor.
  1057. `C-d'
  1058.      Delete the character underneath the cursor.
  1059. `M-f'
  1060.      Move forward a word.
  1061. `M-b'
  1062.      Move backward a word.
  1063. `C-a'
  1064.      Move to the start of the line.
  1065. `C-e'
  1066.      Move to the end of the line.
  1067. `C-l'
  1068.      Clear the screen, reprinting the current line at the top.
  1069. `C-_'
  1070. `C-/'
  1071.      Undo the last thing that you did.  You can undo all the way back
  1072.      to an empty line.
  1073. `M-r'
  1074.      Undo all changes made to this line.  This is like typing the `undo'
  1075.      command enough times to get back to the beginning.
  1076.    The above table describes the most basic possible keystrokes that
  1077. you need in order to do editing of the input line.  On most terminals,
  1078. you can also use the arrow keys in place of `C-f' and `C-b' to move
  1079. forward and backward.
  1080.    Notice how `C-f' moves forward a character, while `M-f' moves
  1081. forward a word.  It is a loose convention that control keystrokes
  1082. operate on characters while meta keystrokes operate on words.
  1083.    There is also a function available so that you can clear the screen
  1084. from within Octave programs.
  1085.  - Built-in Function:  clc ()
  1086.  - Built-in Function:  home ()
  1087.      Clear the terminal screen and move the cursor to the upper left
  1088.      corner.
  1089. File: octave,  Node: Killing and Yanking,  Next: Commands For Text,  Prev: Cursor Motion,  Up: Command Line Editing
  1090. Killing and Yanking
  1091. -------------------
  1092.    "Killing" text means to delete the text from the line, but to save
  1093. it away for later use, usually by "yanking" it back into the line.  If
  1094. the description for a command says that it `kills' text, then you can
  1095. be sure that you can get the text back in a different (or the same)
  1096. place later.
  1097.    Here is the list of commands for killing text.
  1098. `C-k'
  1099.      Kill the text from the current cursor position to the end of the
  1100.      line.
  1101. `M-d'
  1102.      Kill from the cursor to the end of the current word, or if between
  1103.      words, to the end of the next word.
  1104. `M-DEL'
  1105.      Kill from the cursor to the start of the previous word, or if
  1106.      between words, to the start of the previous word.
  1107. `C-w'
  1108.      Kill from the cursor to the previous whitespace.  This is
  1109.      different than `M-DEL' because the word boundaries differ.
  1110.    And, here is how to "yank" the text back into the line.  Yanking
  1111. means to copy the most-recently-killed text from the kill buffer.
  1112. `C-y'
  1113.      Yank the most recently killed text back into the buffer at the
  1114.      cursor.
  1115. `M-y'
  1116.      Rotate the kill-ring, and yank the new top.  You can only do this
  1117.      if the prior command is `C-y' or `M-y'.
  1118.    When you use a kill command, the text is saved in a "kill-ring".
  1119. Any number of consecutive kills save all of the killed text together, so
  1120. that when you yank it back, you get it in one clean sweep.  The kill
  1121. ring is not line specific; the text that you killed on a previously
  1122. typed line is available to be yanked back later, when you are typing
  1123. another line.
  1124.