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