home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21eb.zip / octave / doc / octave.i01 < prev    next >
Encoding:
GNU Info File  |  1999-05-13  |  49.6 KB  |  1,559 lines

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