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