% Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2005, 2006,
%               2007, 2008, 2009 John W. Eaton
%
% This file is part of Octave.
%
% Octave is free software; you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by the
% Free Software Foundation; either version 3 of the License, or (at
% your option) any later version.
% 
% Octave is distributed in the hope that it will be useful, but WITHOUT
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
% for more details.
% 
% You should have received a copy of the GNU General Public License
% along with Octave; see the file COPYING.  If not, see
% <http://www.gnu.org/licenses/>.

\input texinfo
@setfilename octave.info

@c The following macro is used for the on-line help system, but we don't
@c want lots of `See also: foo, bar, and baz' strings cluttering the
@c printed manual (that information should be in the supporting text for
@c each group of functions and variables).

@macro seealso {args}
@iftex
@vskip 2pt
@end iftex
@ifnottex
@sp 1
@end ifnottex
@noindent
@strong{See also:} \args\.
@end macro

@ifinfo
@format
START-INFO-DIR-ENTRY
* Octave: (octave).	Interactive language for numerical computations.
END-INFO-DIR-ENTRY
@end format
@end ifinfo

@c Settings for printing on 8-1/2 by 11 inch paper:
@c -----------------------------------------------

@setchapternewpage odd

@c Settings for small book format:
@c ------------------------------

@ignore
@smallbook
@setchapternewpage odd
@finalout
@iftex
@cropmarks
@end iftex
@end ignore

@defindex op

@c Things like the Octave version number are defined in conf.texi.
@c This file doesn't include a chapter, so it must not be included
@c if you want to run the Emacs function texinfo-multiple-files-update.

@include conf.texi

@settitle GNU Octave

@ifnottex

Copyright @copyright{} 1996, 1997, 1999, 2000, 2001, 2002, 2005, 2006,
2007 John W. Eaton.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

@ignore
Permission is granted to process this file through Tex and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).

@end ignore
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of
a permission notice identical to this one.

Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for
modified versions.
@end ifnottex

@titlepage
@title GNU Octave
@subtitle A high-level interactive language for numerical computations
@subtitle Edition 3 for Octave version @value{VERSION}
@subtitle July 2007
@author John W. Eaton
@author David Bateman
@author S@o{}ren Hauberg
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1996, 1997, 1999, 2000, 2001, 2002, 2005, 2006,
2007 John W. Eaton.

This is the third edition of the Octave documentation, and is consistent
with version @value{VERSION} of Octave.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the same conditions as for modified versions.

Portions of this document have been adapted from the @code{gawk},
@code{readline}, @code{gcc}, and C library manuals, published by the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301--1307, USA.
@end titlepage

@contents

@ifnottex
@node Top
@top

This manual documents how to run, install and port GNU Octave, as well
as its new features and incompatibilities, and how to report bugs.
It corresponds to GNU Octave version @value{VERSION}.
@end ifnottex

@c ------------------------------------------------------------------------

@menu
* Preface::                     
* Introduction::                A brief introduction to Octave.
* Getting Started::             
* Data Types::                  
* Numeric Data Types::          
* Strings::                     
* Data Containers::             
* Variables::                   
* Expressions::                 Expressions.
* Evaluation::                  
* Statements::                  Looping and program flow control.
* Functions and Scripts::       
* Errors and Warnings::              
* Debugging::
* Input and Output::            
* Plotting::                    
* Matrix Manipulation::         
* Arithmetic::                  
* Linear Algebra::              
* Nonlinear Equations::         
* Diagonal and Permutation Matrices::
* Sparse Matrices::
* Numerical Integration::                  
* Differential Equations::      
* Optimization::                
* Statistics::                  
* Sets::                        
* Polynomial Manipulations::    
* Interpolation::
* Geometry::
* Signal Processing::           
* Image Processing::            
* Audio Processing::            
* Object Oriented Programming::            
* System Utilities::            
* Packages:: 
* Dynamically Linked Functions::
* Test and Demo Functions::
* Tips::                        
* Contributing Guidelines::
* Trouble::                     If you have trouble installing Octave.
* Installation::                How to configure, compile and install Octave.
* Emacs::                       
@c * Grammar::                     
* Copying::                     The GNU General Public License.
* Concept Index::               An item for each concept.
* Function Index::              An item for each documented function.
* Operator Index::              An item for each documented operator.

@c FIXME -- is the detailed node listing up to date?
@detailmenu
 --- The Detailed Node Listing ---

Preface

* Acknowledgements::            
* How You Can Contribute to Octave::  
* Distribution::                

A Brief Introduction to Octave

* Running Octave::              
* Simple Examples::             
* Conventions::                 

Conventions

* Fonts::                       
* Evaluation Notation::         
* Printing Notation::           
* Error Messages::              
* Format of Descriptions::      

Format of Descriptions

* A Sample Function Description::  
* A Sample Command Description::  
* A Sample Variable Description::  

Getting Started

* Invoking Octave from the Command Line::             
* Quitting Octave::             
* Getting Help::                
* Command Line Editing::        
* Errors::                      
* Executable Octave Programs::  
* Comments::                    

Invoking Octave from the Command Line

* Command Line Options::        
* Startup Files::               

Command Line Editing

* Cursor Motion::               
* Killing and Yanking::         
* Commands For Text::           
* Commands For Completion::     
* Commands For History::        
* Customizing readline::        
* Customizing the Prompt::      
* Diary and Echo Commands::     

Data Types

* Built-in Data Types::         
* User-defined Data Types::     
* Object Sizes::                

Built-in Data Types

* Numeric Objects::             
* String Objects::              
* Data Structure Objects::      

Numeric Data Types

* Matrices::
* Ranges::
* Single Precision Data Types::
* Integer Data Types::
* Bit Manipulations::
* Logical Values:: 
* Promotion and Demotion of Data Types::
* Predicates for Numeric Objects::  

Matrices

* Empty Matrices::              

Strings

* Creating Strings::            
* Comparing Strings::
* Manipulating Strings::     
* String Conversions::          
* Character Class Functions::   

Data Containers

* Data Structures::
* Cell Arrays::
* Comma Separated Lists::

Expressions

* Index Expressions::           
* Calling Functions::           
* Arithmetic Ops::              
* Comparison Ops::              
* Boolean Expressions::         
* Assignment Ops::              
* Increment Ops::               
* Operator Precedence::         

Calling Functions

Variables

* Global Variables::            
* Status of Variables::         

* Call by Value::               
* Recursion::                   

Boolean Expressions

* Element-by-element Boolean Operators::  
* Short-circuit Boolean Operators::  

Statements

* The if Statement::            
* The switch Statement::        
* The while Statement::         
* The do-until Statement::      
* The for Statement::           
* The break Statement::         
* The continue Statement::      
* The unwind_protect Statement::  
* The try Statement::           
* Continuation Lines::          

The @code{for} Statement

* Looping Over Structure Elements::  

Functions and Script Files

* Defining Functions::          
* Multiple Return Values::      
* Variable-length Argument Lists::  
* Variable-length Return Lists::  
* Returning From a Function::   
* Function Files::              
* Script Files::                
* Organization of Functions::   

Errors and Warnings

* Handling Errors::
* Handling Warnings::

Debugging

* Entering Debug Mode::
* Leaving Debug Mode::
* Breakpoints::
* Debug Mode::
* Call Stack::

Input and Output

* Basic Input and Output::      
* C-Style I/O Functions::       

Basic Input and Output

* Terminal Output::             
* Terminal Input::              
* Simple File I/O::             

C-Style I/O Functions

* Opening and Closing Files::   
* Simple Output::               
* Line-Oriented Input::         
* Formatted Output::            
* Output Conversion for Matrices::  
* Output Conversion Syntax::    
* Table of Output Conversions::  
* Integer Conversions::         
* Floating-Point Conversions::
* Other Output Conversions::    
* Formatted Input::             
* Input Conversion Syntax::     
* Table of Input Conversions::  
* Numeric Input Conversions::   
* String Input Conversions::    
* Binary I/O::                  
* Temporary Files::             
* EOF and Errors::              
* File Positioning::            

Plotting

* Plotting Basics::
* Advanced Plotting::

Matrix Manipulation

* Finding Elements and Checking Conditions::  
* Rearranging Matrices::        
* Applying a Function to an Array::
* Special Utility Matrices::    
* Famous Matrices::             

Arithmetic

* Utility Functions::           
* Complex Arithmetic::          
* Trigonometry::                
* Sums and Products::           
* Special Functions::           
* Mathematical Constants::      

Linear Algebra

* Techniques used for Linear Algebra::
* Basic Matrix Functions::      
* Matrix Factorizations::       
* Functions of a Matrix::       

Diagonal and Permutation Matrices

* Basic Usage::
* Matrix Algebra::
* Function Support::
* Example Codes::
* Zeros Treatment::

Sparse Matrices

* Basics::
* Sparse Linear Algebra::
* Iterative Techniques::
* Real Life Example::

Numerical Integration

* Functions of One Variable::   
* Orthogonal Collocation::      
* Functions of Multiple Variables:: 

Differential Equations

* Ordinary Differential Equations::  
* Differential-Algebraic Equations::  

Optimization

* Quadratic Programming::       
* Nonlinear Programming::       
* Linear Least Squares::        

Statistics

* Descriptive Statistics::
* Basic Statistical Functions:: 
* Statistical Plots:: 
* Tests::                       
* Models::                      
* Distributions::     
* Random Number Generation::          

Sets

* Set Operations::

Polynomial Manipulations

* Evaluating Polynomials::
* Finding Roots::
* Products of Polynomials::
* Derivatives and Integrals::
* Polynomial Interpolation::
* Miscellaneous Functions::

Interpolation

* One-dimensional Interpolation::
* Multi-dimensional Interpolation::

Geometry

* Delaunay Triangulation::
* Voronoi Diagrams::
* Convex Hull::
* Interpolation on Scattered Data::

Image Processing

* Loading and Saving Images::   
* Displaying Images::           
* Representing Images::         
* Plotting on top of Images::   
* Color Conversion::            

Object Oriented Programming

* Creating a Class:
* Manipulating Classes::
* Indexing Objects::
* Overloading Objects::

System Utilities

* Timing Utilities::            
* Filesystem Utilities::        
* File Archiving Utilities::
* Networking Utilities::
* Controlling Subprocesses::    
* Process ID Information::      
* Environment Variables::       
* Current Working Directory::   
* Password Database Functions::  
* Group Database Functions::    
* System Information::          
* Hashing Functions::

Packages

* Installing and Removing Packages::
* Using Packages::
* Administrating Packages::
* Creating Packages::
* The DESCRIPTION File::        
* The INDEX file::              
* PKG_ADD and PKG_DEL directives::  

Dynamically Linked Functions

* Oct-Files::
* Mex-Files::
* Standalone Programs::

Test and Demo Functions

* Test Functions::
* Demonstration Functions::

Tips and Standards

* Style Tips::                  Writing clean and robust programs.
* Coding Tips::                 Making code run faster.
* Documentation Tips::          Writing readable documentation strings.
* Comment Tips::                Conventions for writing comments.
* Function Headers::            Standard headers for functions.

Known Causes of Trouble with Octave

* Actual Bugs::                 Bugs we will fix later.
* Reporting Bugs::              
* Bug Criteria::                
* Bug Lists::                   
* Bug Reporting::               
* Sending Patches::             
* Service::                     

Reporting Bugs

* Bug Criteria::                
* Where: Bug Lists.             Where to send your bug report.
* Reporting: Bug Reporting.     How to report a bug effectively.
* Patches: Sending Patches.     How to send a patch for Octave.

Installing Octave

* Installation Problems::       

Emacs Octave Support

* Installing EOS::              
* Using Octave Mode::           
* Running Octave From Within Emacs::  
* Using the Emacs Info Reader for Octave::  

@c Grammar
@c 
@c * Keywords::                    

@end detailmenu
@end menu

@c ------------------------------------------------------------------------

@include preface.texi
@include intro.texi
@include basics.texi
@include data.texi
@include numbers.texi
@include strings.texi
@include container.texi
@include var.texi
@include expr.texi
@include eval.texi
@include stmt.texi
@include func.texi
@include errors.texi
@include debug.texi
@include io.texi
@include plot.texi
@include matrix.texi
@include arith.texi
@include linalg.texi
@include nonlin.texi
@include diagperm.texi
@include sparse.texi
@include quad.texi
@include diffeq.texi
@include optim.texi
@include stats.texi
@include set.texi
@include poly.texi
@include interp.texi
@include geometry.texi
@include signal.texi
@include image.texi
@include audio.texi
@include oop.texi
@include system.texi
@include package.texi

@c maybe add again later, if anyone every writes any really interesting
@c fun stuff for Octave.
@c
@c @include amuse.texi

@c Appendices start here.  Installation and bugs have to go before the
@c readline and Info appendices because we want to have separate indices
@c for them, and there appears to be no way to go back to the original
@c set of indices once a redirection has taken place.

@include dynamic.texi
@include testfun.texi
@include tips.texi
@include contrib.texi
@include bugs.texi
@include install.texi
@include emacs.texi
@c @include grammar.texi
@include gpl.texi

@include cp-idx.texi
@c @include vr-idx.texi
@include fn-idx.texi
@include op-idx.texi

@bye
