File: octave.texi

package info (click to toggle)
octave3.2 3.2.4-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 62,936 kB
  • ctags: 37,353
  • sloc: cpp: 219,497; fortran: 116,336; ansic: 10,264; sh: 5,508; makefile: 4,245; lex: 3,573; yacc: 3,062; objc: 2,042; lisp: 1,692; awk: 860; perl: 844
file content (875 lines) | stat: -rw-r--r-- 21,427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
% 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
@c Texinfo @sp should work but in practice produces ugly results for HTML.
@c A simple blank line produces the correct behavior. 
@c @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::                 
* 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 and Standards::                        
* Contributing Guidelines::
* Trouble::                     If you have trouble installing Octave.
* Installation::                How to configure, compile and install Octave.
* Emacs Octave Support::                       
@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.

@detailmenu
 --- The Detailed Node Listing ---

Preface

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

Introduction

* 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::     

Comments

* Single Line Comments::
* Block Comments::
* Comments and the Help System::                    

Data Types

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

Built-in Data Types

* Numeric Objects::             
* Missing Data::                
* String Objects::              
* Data Structure Objects::      
* Cell Array 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::              

Integer Data Types

* Integer Arithmetic::

Strings

* Escape Sequences in string constants::
* Character Arrays::
* Creating Strings:: 
* Comparing Strings::           
* Manipulating Strings::     
* String Conversions::          
* Character Class Functions::   

Creating Strings

* Concatenating Strings:: 
* Conversion of Numerical Data to Strings::

Data Containers

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

Data Structures

* Structure Arrays::
* Creating Structures::
* Manipulating Structures::
* Processing Data in Structures::

Cell Arrays

* Creating Cell Arrays::                 
* Indexing Cell Arrays::
* Cell Arrays of Strings::
* Processing Data in Cell Arrays::

Variables

* Global Variables::            
* Persistent Variables::        
* Status of Variables::         

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::  

Evaluation

* Calling a Function by its Name::
* Evaluation in a Different Context::

Statements

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

The @code{switch} Statement

* Notes for the C programmer::  

The @code{for} Statement

* Looping Over Structure Elements::  

Functions and Scripts

* Defining Functions::          
* Multiple Return Values::      
* Variable-length Argument Lists::  
* Variable-length Return Lists::  
* Returning From a Function::   
* Default Arguments::   
* Function Files::              
* Script Files::                
* Function Handles Inline Functions and Anonymous Functions::
* Commands::
* Organization of Functions::   

Function Files

* Manipulating the load path::
* Subfunctions::
* Private Functions::
* Overloading and Autoloading::
* Function Locking::
* Function Precedence::

Function Handles Inline Functions and Anonymous Functions

* Function Handles::
* Anonymous Functions::
* Inline Functions::

Errors and Warnings

* Handling Errors::
* Handling Warnings::

Handling Errors

* Raising Errors::
* Catching Errors::

Handling Warnings

* Issuing Warnings::
* Enabling and Disabling 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::             
* Rational Approximations::

Terminal Output

* Paging Screen Output::

Simple File I/O

* Saving Data on Unexpected Exits::

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::

Plotting Basics

* Two-Dimensional Plots::       
* Three-Dimensional Plotting::  
* Plot Annotations::            
* Multiple Plots on One Page::  
* Multiple Plot Windows::       
* Printing Plots::              
* Interacting with plots::
* Test Plotting Functions::     

Two-Dimensional Plots

* Two-dimensional Function Plotting::

Three-Dimensional Plotting

* Three-dimensional Function Plotting::
* Three-dimensional Geometric Shapes::

Advanced Plotting

* Graphics Objects::
* Graphics Object Properties::  
* Managing Default Properties::  
* Colors::
* Line Styles::
* Marker Styles::
* Callbacks::
* Object Groups::
* Graphics backends::

Graphics Object Properties

* Root Figure Properties::      
* Figure Properties::           
* Axes Properties::             
* Line Properties::             
* Text Properties::             
* Image Properties::            
* Patch Properties::            
* Surface Properties::          
* Searching Properties::

Object Groups

* Data sources in object groups::
* Area series::
* Bar series::
* Contour groups::
* Error bar series::
* Line series::
* Quiver group::
* Scatter group::
* Stair group::
* Stem Series::
* Surface group::

Graphics backends

* Interaction with gnuplot::

Matrix Manipulation

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

Arithmetic

* Exponents and Logarithms::
* Complex Arithmetic::          
* Trigonometry::                
* Sums and Products::           
* Utility Functions::           
* Special Functions::           
* Coordinate Transformations::
* Mathematical Constants::      

Linear Algebra

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

Diagonal and Permutation Matrices

* Basic Usage::          Creation and Manipulation of Diagonal and Permutation Matrices
* Matrix Algebra::       Linear Algebra with Diagonal and Permutation Matrices
* Function Support::     Functions That Are Aware of These Matrices
* Example Codes::        Some Examples of Usage
* Zeros Treatment::      The Differences in Treatment of Zero Elements

Basic Usage

* Creating Diagonal Matrices::
* Creating Permutation Matrices::
* Explicit and Implicit Conversions::

Matrix Algebra

* Expressions Involving Diagonal Matrices::
* Expressions Involving Permutation Matrices::

Function Support

* Diagonal Matrix Functions::
* Permutation Matrix Functions::

Sparse Matrices

* Basics::                      Creation and Manipulation of Sparse Matrices
* Sparse Linear Algebra::       Linear Algebra on Sparse Matrices
* Iterative Techniques::        Iterative Techniques
* Real Life Example::           Using Sparse Matrices

Basics

* Storage of Sparse Matrices::
* Creating Sparse Matrices::
* Information::
* Operators and Functions::

Operators and Functions

* Sparse Functions::            
* Return Types of Operators and Functions::  
* Mathematical Considerations::  

Numerical Integration

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

Differential Equations

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

Optimization

* Linear Programming::       
* 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::

Delaunay Triangulation

* Plotting the Triangulation::
* Identifying points in Triangulation::

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::

Overloading Objects

* Function Overloading::
* Operator Overloading::
* Precedence of 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::           

Creating Packages

* The DESCRIPTION File::        
* The INDEX file::              
* PKG_ADD and PKG_DEL directives::  

Dynamically Linked Functions

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

Oct-Files

* Getting Started with Oct-Files::  
* Matrices and Arrays in Oct-Files::  
* Character Strings in Oct-Files::  
* Cell Arrays in Oct-Files::    
* Structures in Oct-Files::  
* Sparse Matrices in Oct-Files::  
* Accessing Global Variables in Oct-Files::  
* Calling Octave Functions from Oct-Files::  
* Calling External Code from Oct-Files::  
* Allocating Local Memory in Oct-Files::  
* Input Parameter Checking in Oct-Files::  
* Exception and Error Handling in Oct-Files::  
* Documentation and Test of Oct-Files::  

Sparse Matrices in Oct-Files

* Array and Sparse Differences::  
* Creating Sparse Matrices in Oct-Files::  
* Using Sparse Matrices in Oct-Files::  

Mex-Files

* Getting Started with Mex-Files::  
* Working with Matrices and Arrays in Mex-Files::  
* Character Strings in Mex-Files::  
* Cell Arrays with Mex-Files::  
* Structures with Mex-Files::  
* Sparse Matrices with Mex-Files::  
* Calling Other Functions in Mex-Files::  

Test and Demo Functions

* Test Functions::
* Demonstration Functions::

Tips and Standards

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

Contributing Guidelines

* How to Contribute::
* General Guidelines::
* Octave Sources (m-files)::
* C++ Sources::
* Other Sources::	

Trouble

* 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.

Installation

* Installation Problems::       

Emacs Octave Support

* Installing EOS::              
* Using Octave Mode::           
* Running Octave From Within Emacs::  
* Using the Emacs Info Reader for Octave::  
@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 ------------------------------------------------------------------------
@c Appendices start here. 

@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

@c ------------------------------------------------------------------------
@c Indices start here. 

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

@bye