═══ 1. Title page ═══ GNU Octave A high-level interactive language for numerical computations Edition 3 for Octave version 2.1.23 February 1997 John W. Eaton Copyright (C) 1996, 1997 John W. Eaton. This is the third edition of the Octave documentation, and is consistent with version 2.1.23 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 gawk, readline, gcc, and C library manuals, published by the Free Software Foundation, 59 Temple Place---Suite 330, Boston, MA 02111--1307, USA. ═══ 2. 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 2.1.23. Preface Introduction A brief introduction to Octave. Getting Started Data Types Numeric Data Types Strings Data Structures Variables Expressions Expressions. Evaluation Statements Looping and program flow control. Functions and Scripts Error Handling Input and Output Plotting Matrix Manipulation Arithmetic Linear Algebra Nonlinear Equations Quadrature Differential Equations Optimization Statistics Sets Polynomial Manipulations Control Theory Signal Processing Image Processing Audio Processing System Utilities Tips Trouble If you have trouble installing Octave. Installation How to configure, compile and install Octave. Emacs Grammar Copying The GNU General Public License. Concept Index An item for each concept. Variable Index An item for each documented variable. Function Index An item for each documented function. Operator Index An item for each documented operator. --- 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 Quitting Octave Getting Help Command Line Editing Errors Executable Octave Programs Comments Invoking Octave Command Line Options Startup Files Command Line Editing Cursor Motion Killing and Yanking Commands For Text Commands For Completion Commands For History 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 Predicates for Numeric Objects Matrices Empty Matrices Strings Creating Strings Searching and Replacing String Conversions Character Class Functions Variables Global Variables Status of Variables Summary of Built-in Variables Defaults from the Environment Expressions Index Expressions Calling Functions Arithmetic Ops Comparison Ops Boolean Expressions Assignment Ops Increment Ops Operator Precedence Calling Functions 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 for Statement The break Statement The continue Statement The unwind_protect Statement The try Statement Continuation Lines The 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 Dynamically Linked Functions Organization of Functions 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:: 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 Two-Dimensional Plotting Specialized Two-Dimensional Plots Three-Dimensional Plotting Plot Annotations Multiple Plots on One Page Matrix Manipulation Finding Elements and Checking Conditions Rearranging Matrices Special Utility Matrices Famous Matrices Arithmetic Utility Functions Complex Arithmetic Trigonometry Sums and Products Special Functions Mathematical Constants Linear Algebra Basic Matrix Functions Matrix Factorizations Functions of a Matrix Quadrature Functions of One Variable Orthogonal Collocation Differential Equations Ordinary Differential Equations Differential-Algebraic Equations Optimization Quadratic Programming Nonlinear Programming Linear Least Squares Control Theory sysstruct sysinterface sysdisp blockdiag numerical sysprop systime sysfreq cacsd misc System Data Structure sysstructvars sysstructtf sysstructzp sysstructss System Construction and Interface Functions fir2sys ss2sys tf2sys zp2sys structaccess structintern System Utilities Timing Utilities Filesystem Utilities Controlling Subprocesses Process ID Information Environment Variables Current Working Directory Password Database Functions Group Database Functions System Information 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 Binary Distributions Binary Distributions Installing Octave from a Binary Distribution Creating a Binary Distribution Emacs Octave Support Installing EOS Using Octave Mode Running Octave From Within Emacs Using the Emacs Info Reader for Octave Grammar Keywords