7018
|
1 % Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2005, 2006, |
|
2 % 2007 John W. Eaton |
|
3 % |
|
4 % This file is part of Octave. |
|
5 % |
|
6 % Octave is free software; you can redistribute it and/or modify it |
|
7 % under the terms of the GNU General Public License as published by the |
|
8 % Free Software Foundation; either version 3 of the License, or (at |
|
9 % your option) any later version. |
|
10 % |
|
11 % Octave is distributed in the hope that it will be useful, but WITHOUT |
|
12 % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 % FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 % for more details. |
|
15 % |
|
16 % You should have received a copy of the GNU General Public License |
|
17 % along with Octave; see the file COPYING. If not, see |
|
18 % <http://www.gnu.org/licenses/>. |
3403
|
19 |
|
20 \input texinfo |
|
21 @setfilename octave.info |
|
22 |
3405
|
23 @c The following macro is used for the on-line help system, but we don't |
|
24 @c want lots of `See also: foo, bar, and baz' strings cluttering the |
|
25 @c printed manual (that information should be in the supporting text for |
3406
|
26 @c each group of functions and variables). |
3405
|
27 |
|
28 @macro seealso {args} |
6620
|
29 @iftex |
|
30 @vskip 2pt |
|
31 @end iftex |
|
32 @ifnottex |
5642
|
33 @sp 1 |
6620
|
34 @end ifnottex |
5642
|
35 @noindent |
6620
|
36 @strong{See also:} \args\. |
3405
|
37 @end macro |
|
38 |
3403
|
39 @ifinfo |
|
40 @format |
|
41 START-INFO-DIR-ENTRY |
|
42 * Octave: (octave). Interactive language for numerical computations. |
|
43 END-INFO-DIR-ENTRY |
|
44 @end format |
|
45 @end ifinfo |
|
46 |
|
47 @c Settings for printing on 8-1/2 by 11 inch paper: |
|
48 @c ----------------------------------------------- |
|
49 |
|
50 @setchapternewpage odd |
|
51 |
|
52 @c Settings for small book format: |
|
53 @c ------------------------------ |
|
54 |
|
55 @ignore |
|
56 @smallbook |
|
57 @setchapternewpage odd |
|
58 @finalout |
|
59 @iftex |
|
60 @cropmarks |
|
61 @end iftex |
|
62 @end ignore |
|
63 |
|
64 @defindex op |
|
65 |
3453
|
66 @c Things like the Octave version number are defined in conf.texi. |
3403
|
67 @c This file doesn't include a chapter, so it must not be included |
|
68 @c if you want to run the Emacs function texinfo-multiple-files-update. |
|
69 |
|
70 @include conf.texi |
|
71 |
|
72 @settitle GNU Octave |
|
73 |
5423
|
74 @ifnottex |
3403
|
75 |
7018
|
76 Copyright @copyright{} 1996, 1997, 1999, 2000, 2001, 2002, 2005, 2006, |
|
77 2007 John W. Eaton. |
3403
|
78 |
|
79 Permission is granted to make and distribute verbatim copies of |
|
80 this manual provided the copyright notice and this permission notice |
|
81 are preserved on all copies. |
|
82 |
|
83 @ignore |
|
84 Permission is granted to process this file through Tex and print the |
|
85 results, provided the printed document carries copying permission |
|
86 notice identical to this one except for the removal of this paragraph |
|
87 (this paragraph not being relevant to the printed manual). |
|
88 |
|
89 @end ignore |
|
90 Permission is granted to copy and distribute modified versions of |
|
91 this manual under the conditions for verbatim copying, provided that |
|
92 the entire resulting derived work is distributed under the terms of |
|
93 a permission notice identical to this one. |
|
94 |
|
95 Permission is granted to copy and distribute translations of this |
|
96 manual into another language, under the above conditions for |
|
97 modified versions. |
5423
|
98 @end ifnottex |
3403
|
99 |
|
100 @titlepage |
|
101 @title GNU Octave |
|
102 @subtitle A high-level interactive language for numerical computations |
|
103 @subtitle Edition 3 for Octave version @value{VERSION} |
6778
|
104 @subtitle July 2007 |
3403
|
105 @author John W. Eaton |
6966
|
106 @author David Bateman |
|
107 @author S@o{}ren Hauberg |
3403
|
108 @page |
|
109 @vskip 0pt plus 1filll |
7018
|
110 Copyright @copyright{} 1996, 1997, 1999, 2000, 2001, 2002, 2005, 2006, |
|
111 2007 John W. Eaton. |
3403
|
112 |
|
113 This is the third edition of the Octave documentation, and is consistent |
|
114 with version @value{VERSION} of Octave. |
|
115 |
|
116 Permission is granted to make and distribute verbatim copies of |
|
117 this manual provided the copyright notice and this permission notice |
|
118 are preserved on all copies. |
|
119 |
|
120 Permission is granted to copy and distribute modified versions of this |
|
121 manual under the conditions for verbatim copying, provided that the entire |
|
122 resulting derived work is distributed under the terms of a permission |
|
123 notice identical to this one. |
|
124 |
|
125 Permission is granted to copy and distribute translations of this manual |
|
126 into another language, under the same conditions as for modified versions. |
|
127 |
|
128 Portions of this document have been adapted from the @code{gawk}, |
|
129 @code{readline}, @code{gcc}, and C library manuals, published by the Free |
5307
|
130 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
131 02110-1301--1307, USA. |
3403
|
132 @end titlepage |
|
133 |
3606
|
134 @contents |
|
135 |
5423
|
136 @ifnottex |
4167
|
137 @node Top |
3403
|
138 @top |
|
139 |
|
140 This manual documents how to run, install and port GNU Octave, as well |
|
141 as its new features and incompatibilities, and how to report bugs. |
|
142 It corresponds to GNU Octave version @value{VERSION}. |
5423
|
143 @end ifnottex |
3403
|
144 |
5424
|
145 @c ------------------------------------------------------------------------ |
|
146 |
3403
|
147 @menu |
|
148 * Preface:: |
|
149 * Introduction:: A brief introduction to Octave. |
|
150 * Getting Started:: |
|
151 * Data Types:: |
|
152 * Numeric Data Types:: |
|
153 * Strings:: |
6837
|
154 * Data Containers:: |
3403
|
155 * Variables:: |
|
156 * Expressions:: Expressions. |
|
157 * Evaluation:: |
|
158 * Statements:: Looping and program flow control. |
|
159 * Functions and Scripts:: |
6667
|
160 * Errors and Warnings:: |
4178
|
161 * Debugging:: |
3403
|
162 * Input and Output:: |
|
163 * Plotting:: |
|
164 * Matrix Manipulation:: |
|
165 * Arithmetic:: |
|
166 * Linear Algebra:: |
|
167 * Nonlinear Equations:: |
5164
|
168 * Sparse Matrices:: |
6741
|
169 * Numerical Integration:: |
3403
|
170 * Differential Equations:: |
|
171 * Optimization:: |
|
172 * Statistics:: |
3439
|
173 * Financial Functions:: |
3403
|
174 * Sets:: |
|
175 * Polynomial Manipulations:: |
6549
|
176 * Interpolation:: |
6558
|
177 * Geometry:: |
3403
|
178 * Control Theory:: |
|
179 * Signal Processing:: |
|
180 * Image Processing:: |
|
181 * Audio Processing:: |
3452
|
182 * Quaternions:: |
3403
|
183 * System Utilities:: |
6570
|
184 * Packages:: |
|
185 * Dynamically Linked Functions:: |
5582
|
186 * Test and Demo Functions:: |
3403
|
187 * Tips:: |
|
188 * Trouble:: If you have trouble installing Octave. |
|
189 * Installation:: How to configure, compile and install Octave. |
|
190 * Emacs:: |
6623
|
191 @c * Grammar:: |
3403
|
192 * Copying:: The GNU General Public License. |
|
193 * Concept Index:: An item for each concept. |
|
194 * Variable Index:: An item for each documented variable. |
|
195 * Function Index:: An item for each documented function. |
|
196 * Operator Index:: An item for each documented operator. |
|
197 |
|
198 @detailmenu |
|
199 --- The Detailed Node Listing --- |
|
200 |
|
201 Preface |
|
202 |
3453
|
203 * Acknowledgements:: |
|
204 * How You Can Contribute to Octave:: |
|
205 * Distribution:: |
|
206 |
|
207 A Brief Introduction to Octave |
|
208 |
|
209 * Running Octave:: |
|
210 * Simple Examples:: |
|
211 * Conventions:: |
|
212 |
|
213 Conventions |
|
214 |
|
215 * Fonts:: |
|
216 * Evaluation Notation:: |
|
217 * Printing Notation:: |
|
218 * Error Messages:: |
|
219 * Format of Descriptions:: |
|
220 |
|
221 Format of Descriptions |
|
222 |
|
223 * A Sample Function Description:: |
|
224 * A Sample Command Description:: |
|
225 * A Sample Variable Description:: |
|
226 |
|
227 Getting Started |
|
228 |
6620
|
229 * Invoking Octave from the Command Line:: |
3453
|
230 * Quitting Octave:: |
|
231 * Getting Help:: |
|
232 * Command Line Editing:: |
|
233 * Errors:: |
|
234 * Executable Octave Programs:: |
|
235 * Comments:: |
|
236 |
6620
|
237 Invoking Octave from the Command Line |
3453
|
238 |
|
239 * Command Line Options:: |
|
240 * Startup Files:: |
|
241 |
|
242 Command Line Editing |
|
243 |
|
244 * Cursor Motion:: |
|
245 * Killing and Yanking:: |
|
246 * Commands For Text:: |
|
247 * Commands For Completion:: |
|
248 * Commands For History:: |
|
249 * Customizing readline:: |
|
250 * Customizing the Prompt:: |
|
251 * Diary and Echo Commands:: |
|
252 |
|
253 Data Types |
|
254 |
|
255 * Built-in Data Types:: |
|
256 * User-defined Data Types:: |
|
257 * Object Sizes:: |
|
258 |
|
259 Built-in Data Types |
|
260 |
|
261 * Numeric Objects:: |
|
262 * String Objects:: |
|
263 * Data Structure Objects:: |
|
264 |
|
265 Numeric Data Types |
|
266 |
|
267 * Matrices:: |
|
268 * Ranges:: |
6549
|
269 * Integer Data Types:: |
6781
|
270 * Bit Manipulations:: |
3453
|
271 * Logical Values:: |
|
272 * Predicates for Numeric Objects:: |
|
273 |
|
274 Matrices |
|
275 |
|
276 * Empty Matrices:: |
|
277 |
|
278 Strings |
|
279 |
|
280 * Creating Strings:: |
6623
|
281 * Comparing Strings:: |
|
282 * Manipulating Strings:: |
3453
|
283 * String Conversions:: |
|
284 * Character Class Functions:: |
|
285 |
6837
|
286 Data Containers |
3453
|
287 |
6837
|
288 * Data Structures:: |
|
289 * Cell Arrays:: |
|
290 * Comma Separated Lists:: |
3453
|
291 |
|
292 Variables |
|
293 |
|
294 * Global Variables:: |
|
295 * Status of Variables:: |
|
296 * Summary of Built-in Variables:: |
|
297 * Defaults from the Environment:: |
|
298 |
|
299 Expressions |
|
300 |
|
301 * Index Expressions:: |
|
302 * Calling Functions:: |
|
303 * Arithmetic Ops:: |
|
304 * Comparison Ops:: |
|
305 * Boolean Expressions:: |
|
306 * Assignment Ops:: |
|
307 * Increment Ops:: |
|
308 * Operator Precedence:: |
|
309 |
|
310 Calling Functions |
|
311 |
|
312 * Call by Value:: |
|
313 * Recursion:: |
|
314 |
|
315 Boolean Expressions |
|
316 |
|
317 * Element-by-element Boolean Operators:: |
|
318 * Short-circuit Boolean Operators:: |
|
319 |
|
320 Statements |
|
321 |
|
322 * The if Statement:: |
|
323 * The switch Statement:: |
|
324 * The while Statement:: |
3489
|
325 * The do-until Statement:: |
3453
|
326 * The for Statement:: |
|
327 * The break Statement:: |
|
328 * The continue Statement:: |
|
329 * The unwind_protect Statement:: |
|
330 * The try Statement:: |
|
331 * Continuation Lines:: |
|
332 |
|
333 The @code{for} Statement |
|
334 |
|
335 * Looping Over Structure Elements:: |
|
336 |
|
337 Functions and Script Files |
|
338 |
|
339 * Defining Functions:: |
|
340 * Multiple Return Values:: |
|
341 * Variable-length Argument Lists:: |
|
342 * Variable-length Return Lists:: |
|
343 * Returning From a Function:: |
|
344 * Function Files:: |
|
345 * Script Files:: |
|
346 * Organization of Functions:: |
|
347 |
6667
|
348 Errors and Warnings |
|
349 |
|
350 * Handling Errors:: |
|
351 * Handling Warnings:: |
4178
|
352 |
|
353 Debugging |
|
354 |
6646
|
355 * Entering Debug Mode:: |
|
356 * Breakpoints:: |
|
357 * Debug Mode:: |
|
358 |
3453
|
359 Input and Output |
|
360 |
|
361 * Basic Input and Output:: |
|
362 * C-Style I/O Functions:: |
|
363 |
|
364 Basic Input and Output |
|
365 |
|
366 * Terminal Output:: |
|
367 * Terminal Input:: |
|
368 * Simple File I/O:: |
|
369 |
|
370 C-Style I/O Functions |
|
371 |
|
372 * Opening and Closing Files:: |
|
373 * Simple Output:: |
|
374 * Line-Oriented Input:: |
|
375 * Formatted Output:: |
|
376 * Output Conversion for Matrices:: |
|
377 * Output Conversion Syntax:: |
|
378 * Table of Output Conversions:: |
|
379 * Integer Conversions:: |
6554
|
380 * Floating-Point Conversions:: |
3453
|
381 * Other Output Conversions:: |
|
382 * Formatted Input:: |
|
383 * Input Conversion Syntax:: |
|
384 * Table of Input Conversions:: |
|
385 * Numeric Input Conversions:: |
|
386 * String Input Conversions:: |
|
387 * Binary I/O:: |
|
388 * Temporary Files:: |
|
389 * EOF and Errors:: |
|
390 * File Positioning:: |
|
391 |
|
392 Plotting |
|
393 |
6888
|
394 * Plotting Basics:: |
|
395 * Advanced Plotting:: |
3453
|
396 |
|
397 Matrix Manipulation |
|
398 |
|
399 * Finding Elements and Checking Conditions:: |
|
400 * Rearranging Matrices:: |
6550
|
401 * Applying a Function to an Array:: |
3453
|
402 * Special Utility Matrices:: |
|
403 * Famous Matrices:: |
|
404 |
|
405 Arithmetic |
|
406 |
|
407 * Utility Functions:: |
|
408 * Complex Arithmetic:: |
|
409 * Trigonometry:: |
|
410 * Sums and Products:: |
|
411 * Special Functions:: |
|
412 * Mathematical Constants:: |
|
413 |
|
414 Linear Algebra |
|
415 |
6531
|
416 * Techniques used for Linear Algebra:: |
3453
|
417 * Basic Matrix Functions:: |
|
418 * Matrix Factorizations:: |
|
419 * Functions of a Matrix:: |
|
420 |
5164
|
421 Sparse Matrices |
|
422 |
|
423 * Basics:: |
|
424 * Sparse Linear Algebra:: |
|
425 * Iterative Techniques:: |
5648
|
426 * Real Life Example:: |
5164
|
427 |
6741
|
428 Numerical Integration |
3453
|
429 |
|
430 * Functions of One Variable:: |
|
431 * Orthogonal Collocation:: |
6741
|
432 * Functions of Multiple Variables:: |
3453
|
433 |
|
434 Differential Equations |
|
435 |
|
436 * Ordinary Differential Equations:: |
|
437 * Differential-Algebraic Equations:: |
|
438 |
|
439 Optimization |
|
440 |
|
441 * Quadratic Programming:: |
|
442 * Nonlinear Programming:: |
|
443 * Linear Least Squares:: |
|
444 |
|
445 Statistics |
|
446 |
6754
|
447 * Descriptive Statistics:: |
|
448 * Basic Statistical Functions:: |
|
449 * Statistical Plots:: |
3489
|
450 * Tests:: |
3453
|
451 * Models:: |
6754
|
452 * Distributions:: |
|
453 * Random Number Generation:: |
3453
|
454 |
6741
|
455 Sets |
|
456 |
|
457 * Set Operations:: |
|
458 |
6850
|
459 Polynomial Manipulations |
|
460 |
|
461 * Evaluating Polynomials:: |
|
462 * Finding Roots:: |
|
463 * Products of Polynomials:: |
|
464 * Derivatives and Integrals:: |
|
465 * Polynomial Interpolation:: |
|
466 * Miscellaneous Functions:: |
|
467 |
6702
|
468 Interpolation |
6823
|
469 |
6702
|
470 * One-dimensional Interpolation:: |
|
471 * Multi-dimensional Interpolation:: |
6570
|
472 |
6823
|
473 Geometry |
|
474 |
|
475 * Delaunay Triangulation:: |
|
476 * Voronoi Diagrams:: |
|
477 * Convex Hull:: |
|
478 * Interpolation on Scattered Data:: |
|
479 |
3453
|
480 Control Theory |
|
481 |
|
482 * sysstruct:: |
|
483 * sysinterface:: |
|
484 * sysdisp:: |
|
485 * blockdiag:: |
|
486 * numerical:: |
|
487 * sysprop:: |
|
488 * systime:: |
|
489 * sysfreq:: |
|
490 * cacsd:: |
|
491 * misc:: |
|
492 |
|
493 System Data Structure |
|
494 |
|
495 * sysstructvars:: |
|
496 * sysstructtf:: |
|
497 * sysstructzp:: |
|
498 * sysstructss:: |
|
499 |
|
500 System Construction and Interface Functions |
|
501 |
|
502 * fir2sys:: |
|
503 * ss2sys:: |
|
504 * tf2sys:: |
|
505 * zp2sys:: |
|
506 * structaccess:: |
|
507 |
6535
|
508 Image Processing |
|
509 |
|
510 * Loading and Saving Images:: |
|
511 * Displaying Images:: |
|
512 * Representing Images:: |
|
513 * Plotting on top of Images:: |
|
514 * Color Conversion:: |
|
515 |
3453
|
516 System Utilities |
|
517 |
|
518 * Timing Utilities:: |
|
519 * Filesystem Utilities:: |
6549
|
520 * File Archiving Utilities:: |
|
521 * Networking Utilities:: |
3453
|
522 * Controlling Subprocesses:: |
|
523 * Process ID Information:: |
|
524 * Environment Variables:: |
|
525 * Current Working Directory:: |
|
526 * Password Database Functions:: |
|
527 * Group Database Functions:: |
|
528 * System Information:: |
6702
|
529 * Hashing Functions:: |
3453
|
530 |
6537
|
531 Packages |
|
532 |
|
533 * Installing and Removing Packages:: |
|
534 * Using Packages:: |
|
535 * Administrating Packages:: |
|
536 * Creating Packages:: |
|
537 * The DESCRIPTION File:: |
|
538 * The INDEX file:: |
|
539 * PKG_ADD and PKG_DEL directives:: |
|
540 |
6570
|
541 Dynamically Linked Functions |
|
542 |
|
543 * Oct-Files:: |
|
544 * Mex-Files:: |
|
545 * Standalone Programs:: |
|
546 |
5582
|
547 Test and Demo Functions |
|
548 |
|
549 * Test Functions:: |
|
550 * Demonstration Functions:: |
|
551 |
3453
|
552 Tips and Standards |
|
553 |
|
554 * Style Tips:: Writing clean and robust programs. |
|
555 * Coding Tips:: Making code run faster. |
|
556 * Documentation Tips:: Writing readable documentation strings. |
|
557 * Comment Tips:: Conventions for writing comments. |
|
558 * Function Headers:: Standard headers for functions. |
|
559 |
|
560 Known Causes of Trouble with Octave |
|
561 |
|
562 * Actual Bugs:: Bugs we will fix later. |
|
563 * Reporting Bugs:: |
|
564 * Bug Criteria:: |
|
565 * Bug Lists:: |
|
566 * Bug Reporting:: |
|
567 * Sending Patches:: |
|
568 * Service:: |
|
569 |
|
570 Reporting Bugs |
|
571 |
|
572 * Bug Criteria:: |
|
573 * Where: Bug Lists. Where to send your bug report. |
|
574 * Reporting: Bug Reporting. How to report a bug effectively. |
|
575 * Patches: Sending Patches. How to send a patch for Octave. |
|
576 |
|
577 Installing Octave |
|
578 |
|
579 * Installation Problems:: |
|
580 |
|
581 Emacs Octave Support |
|
582 |
|
583 * Installing EOS:: |
|
584 * Using Octave Mode:: |
|
585 * Running Octave From Within Emacs:: |
|
586 * Using the Emacs Info Reader for Octave:: |
|
587 |
6623
|
588 @c Grammar |
6624
|
589 @c |
|
590 @c * Keywords:: |
3453
|
591 |
|
592 @end detailmenu |
3403
|
593 @end menu |
|
594 |
5424
|
595 @c ------------------------------------------------------------------------ |
|
596 |
3403
|
597 @include preface.texi |
|
598 @include intro.texi |
|
599 @include basics.texi |
|
600 @include data.texi |
|
601 @include numbers.texi |
|
602 @include strings.texi |
3439
|
603 @include container.texi |
3403
|
604 @include var.texi |
|
605 @include expr.texi |
|
606 @include eval.texi |
|
607 @include stmt.texi |
|
608 @include func.texi |
|
609 @include errors.texi |
4167
|
610 @include debug.texi |
3403
|
611 @include io.texi |
|
612 @include plot.texi |
|
613 @include matrix.texi |
|
614 @include arith.texi |
|
615 @include linalg.texi |
|
616 @include nonlin.texi |
5164
|
617 @include sparse.texi |
3403
|
618 @include quad.texi |
|
619 @include diffeq.texi |
|
620 @include optim.texi |
|
621 @include stats.texi |
3439
|
622 @include finance.texi |
3403
|
623 @include set.texi |
|
624 @include poly.texi |
6549
|
625 @include interp.texi |
6558
|
626 @include geometry.texi |
3403
|
627 @include control.texi |
|
628 @include signal.texi |
|
629 @include image.texi |
|
630 @include audio.texi |
3452
|
631 @include quaternion.texi |
3403
|
632 @include system.texi |
6537
|
633 @include package.texi |
3403
|
634 |
|
635 @c maybe add again later, if anyone every writes any really interesting |
|
636 @c fun stuff for Octave. |
|
637 @c |
|
638 @c @include amuse.texi |
|
639 |
|
640 @c Appendices start here. Installation and bugs have to go before the |
|
641 @c readline and Info appendices because we want to have separate indices |
|
642 @c for them, and there appears to be no way to go back to the original |
|
643 @c set of indices once a redirection has taken place. |
|
644 |
6570
|
645 @include dynamic.texi |
5582
|
646 @include testfun.texi |
3403
|
647 @include tips.texi |
|
648 @include bugs.texi |
|
649 @include install.texi |
|
650 @include emacs.texi |
6618
|
651 @c @include grammar.texi |
3403
|
652 @include gpl.texi |
|
653 |
|
654 @include cp-idx.texi |
|
655 @include vr-idx.texi |
|
656 @include fn-idx.texi |
|
657 @include op-idx.texi |
|
658 |
|
659 @bye |