annotate doc/faq/Octave-FAQ.texi @ 4831:4ec7d24b4943

[project @ 2004-03-10 06:14:52 by jwe]
author jwe
date Wed, 10 Mar 2004 06:14:52 +0000
parents a3dd9369a1d4
children b2ce28713791
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1 \input texinfo.tex @c -*-texinfo-*-
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
2
3030
353071b4970b [project @ 1997-06-05 07:31:36 by jwe]
jwe
parents: 2866
diff changeset
3 @setfilename Octave-FAQ.info
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
4 @settitle Frequently asked questions about Octave (with answers)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
5
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
6 @setchapternewpage off
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
7
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
8 @titlepage
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
9 @title Octave FAQ
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
10 @subtitle Frequently asked questions about Octave
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
11 @subtitle February 14, 1998
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
12 @sp 1
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
13 @author John W. Eaton
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
14 @page
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
15 @end titlepage
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
16
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
17 @ifinfo
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
18 @node Top
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
19 @top
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
20 @unnumbered Preface
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
21 @cindex FAQ for Octave, latest version
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
22 @end ifinfo
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
23
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
24 This is a list of frequently asked questions (FAQ) for Octave users.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
25
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
26 Some information in this FAQ was written for earlier versions of
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
27 Octave and may now be obsolete.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
28
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
29 I'm looking for new questions (@emph{with} answers), better answers,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
30 or both. Please send suggestions to bug-octave@@bevo.che.wisc.edu.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
31 If you have general questions about Octave, or need help for something
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
32 that is not covered by the Octave manual or the FAQ, please use the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
33 help-octave@@bevo.che.wisc.edu mailing list.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
34
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
35 This FAQ is intended to supplement, not replace, the Octave manual.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
36 Before posting a question to the help-octave mailing list, you should
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
37 first check to see if the topic is covered in the manual.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
38
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
39 @menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
40 * What is Octave?::
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
41 * How can I cite Octave?::
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
42 * Version 2.0::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
43 * Octave Features::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
44 * Documentation::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
45 * Getting Octave::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
46 * Installation::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
47 * Common problems::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
48 * Getting additional help::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
49 * Bug reports::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
50 * MATLAB compatibility::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
51 * Index::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
52 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
53
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
54 @node What is Octave?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
55 @chapter What is Octave?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
56
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
57 Octave is a high-level interactive language, primarily intended for
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
58 numerical computations that is mostly compatible with
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
59 @sc{Matlab}.@footnote{@sc{Matlab} is a registered trademark of The MathWorks,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
60 Inc.}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
61
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
62 Octave can do arithmetic for real and complex scalars and matrices,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
63 solve sets of nonlinear algebraic equations, integrate functions over
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
64 finite and infinite intervals, and integrate systems of ordinary
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
65 differential and differential-algebraic equations.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
66
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
67 Octave uses the GNU readline library to handle reading and editing
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
68 input. By default, the line editing commands are similar to the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
69 cursor movement commands used by GNU Emacs, and a vi-style line
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
70 editing interface is also available. At the end of each session, the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
71 command history is saved, so that commands entered during previous
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
72 sessions are not lost.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
73
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
74 The Octave distribution includes a 200+ page Texinfo manual. Access
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
75 to the complete text of the manual is available via the help command
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
76 at the Octave prompt.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
77
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
78 Two and three dimensional plotting is fully supported using gnuplot.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
79
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
80 The underlying numerical solvers are currently standard Fortran ones
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
81 like Lapack, Linpack, Odepack, the Blas, etc., packaged in a library
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
82 of C++ classes. If possible, the Fortran subroutines are compiled
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
83 with the system's Fortran compiler, and called directly from the C++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
84 functions. If that's not possible, you can still compile Octave if
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
85 you have the free Fortran to C translator f2c.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
86
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
87 Octave is also free software; you can redistribute it and/or modify it
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
88 under the terms of the GNU General Public License as published by the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
89 Free Software Foundation.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
90
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
91 @node How can I cite Octave?
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
92 @chapter How can I cite Octave?
4831
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
93
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
94 Pointing to @url{http://www.octave.org} is good, because that gives
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
95 people a direct way to find out more. If citation of a URL is not
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
96 allowed by a publisher, or if you also want to point to a traditional
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
97 reference, then you can cite the Octave manual:
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
98
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
99 @example
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
100 @group
4831
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
101 @@BOOK@{eaton:2002,
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
102 author = "John W. Eaton",
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
103 title = "GNU Octave Manual",
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
104 publisher = "Network Theory Limited",
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
105 year = "2002",
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
106 isbn = "0-9541617-2-6"
4831
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
107 @}
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
108 @end group
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
109 @end example
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
110
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
111 @node Version 2.0
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
112 @chapter What's new in version 2.0 of Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
113
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
114 Version 2.0.10 of Octave was released February 6, 1998. Most bugs
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
115 reported since version 2.0 was release have been fixed, and a number of
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
116 new features have been added. Octave is now much more compatible with
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
117 @sc{Matlab}.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
118
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
119 A list of user-visible changes in recent versions of Octave may be found
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
120 in the file NEWS, distributed in both source and binary releases of
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
121 Octave.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
122
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
123 @node Octave Features
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
124 @chapter What features are unique to Octave?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
125
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
126 @menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
127 * Command and variable name completion::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
128 * Command history::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
129 * Data structures::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
130 * Short-circuit boolean operators::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
131 * Increment and decrement operators::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
132 * Unwind-protect::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
133 * Variable-length argument lists::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
134 * Variable-length return lists::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
135 * Built-in ODE and DAE solvers::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
136 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
137
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
138 @node Command and variable name completion
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
139 @section Command and variable name completion
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
140
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
141 @cindex Command completion
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
142 @cindex Function name completion
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
143 @cindex Variable name completion
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
144 @cindex Name completion
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
145
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
146 Typing a TAB character (ASCII code 9) on the command line causes Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
147 to attempt to complete variable, function, and file names. Octave uses
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
148 the text before the cursor as the initial portion of the name to
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
149 complete.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
150
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
151 For example, if you type @samp{fu} followed by TAB at the Octave prompt,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
152 Octave will complete the rest of the name @samp{function} on the command
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
153 line (unless you have other variables or functions defined that begin
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
154 with the characters @samp{fu}). If there is more than one possible
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
155 completion, Octave will ring the terminal bell to let you know that your
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
156 initial sequence of characters is not enough to specify a unique name.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
157 To complete the name, you may either edit the initial character sequence
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
158 (usually adding more characters until completion is possible) or type
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
159 another TAB to cause Octave to display the list of possible completions.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
160
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
161 @node Command history
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
162 @section Command history
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
163
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
164 @cindex Command history
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
165 @cindex History
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
166
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
167 When running interactively, Octave saves the commands you type in an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
168 internal buffer so that you can recall and edit them. Emacs and vi
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
169 editing modes are available with Emacs keybindings enabled by default.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
170
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
171 When Octave exits, the current command history is saved to the file
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
172 @file{~/.octave_hist}, and each time Octave starts, it inserts the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
173 contents of the @file{~/.octave_hist} file in the history list so that
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
174 it is easy to begin working where you left off.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
175
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
176 @node Data structures
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
177 @section Data structures
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
178
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
179 @cindex Data structures
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
180 @cindex Structures
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
181
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
182 Octave includes a limited amount of support for organizing data in
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
183 structures. The current implementation uses an associative array
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
184 with indices limited to strings, but the syntax is more like C-style
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
185 structures. Here are some examples of using data structures in Octave.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
186
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
187 @itemize @bullet
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
188 @item Elements of structures can be of any value type.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
189
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
190 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
191 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
192 octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string";
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
193 octave:2> x.a
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
194 x.a = 1
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
195 octave:3> x.b
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
196 x.b =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
197
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
198 1 2
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
199 3 4
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
200
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
201 octave:4> x.c
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
202 x.c = string
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
203 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
204 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
205
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
206 @item Structures may be copied.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
207
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
208 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
209 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
210 octave:1> y = x
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
211 y =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
212 @{
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
213 a = 1
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
214 b =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
215
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
216 1 2
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
217 3 4
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
218
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
219 c = string
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
220 s =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
221
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
222 0.00000 0.00000 0.00000
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
223 0.00000 5.46499 0.00000
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
224 0.00000 0.00000 0.36597
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
225
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
226 u =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
227
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
228 -0.40455 -0.91451
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
229 -0.91451 0.40455
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
230
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
231 v =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
232
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
233 -0.57605 0.81742
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
234 -0.81742 -0.57605
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
235 @}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
236 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
237 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
238
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
239 @item Structure elements may reference other structures.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
240
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
241 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
242 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
243 octave:1> x.b.d = 3
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
244 x.b.d = 3
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
245 octave:2> x.b
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
246 ans =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
247 @{
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
248 d = 3
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
249 @}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
250 octave:3> x.b.d
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
251 ans = 3
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
252 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
253 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
254
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
255 @item Functions can return structures.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
256
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
257 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
258 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
259 octave:1> function y = f (x)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
260 > y.re = real (x);
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
261 > y.im = imag (x);
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
262 > endfunction
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
263
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
264 octave:2> f (rand + rand*I);
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
265 ans =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
266 @{
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
267 im = 0.18033
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
268 re = 0.19069
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
269 @}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
270 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
271 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
272
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
273 @item Function return lists can include structure elements, and they may
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
274 be indexed like any other variable.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
275
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
276 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
277 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
278 octave:1> [x.u, x.s(2:3,2:3), x.v] = svd ([1, 2; 3, 4]);
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
279 octave:2> x
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
280 x =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
281 @{
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
282 s =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
283
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
284 0.00000 0.00000 0.00000
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
285 0.00000 5.46499 0.00000
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
286 0.00000 0.00000 0.36597
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
287
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
288 u =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
289
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
290 -0.40455 -0.91451
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
291 -0.91451 0.40455
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
292
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
293 v =
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
294
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
295 -0.57605 0.81742
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
296 -0.81742 -0.57605
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
297 @}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
298 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
299 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
300
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
301 @item You can also use the function @code{is_struct} to determine
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
302 whether a given value is a data structure. For example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
303
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
304 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
305 is_struct (x)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
306 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
307
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
308 @noindent
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
309 returns 1 if the value of the variable @var{x} is a data structure.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
310 @end itemize
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
311
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
312 This feature should be considered experimental, but you should expect it
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
313 to work. Suggestions for ways to improve it are welcome.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
314
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
315 @node Short-circuit boolean operators
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
316 @section Short-circuit boolean operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
317
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
318 @cindex Boolean operators, short-circuit
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
319 @cindex Logical operators, short-circuit
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
320 @cindex Short-circuit boolean operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
321 @cindex Operators, boolean
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
322
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
323 Octave's @samp{&&} and @samp{||} logical operators are evaluated in
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
324 a short-circuit fashion (like the corresponding operators in the C
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
325 language) and work differently than the element by element operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
326 @samp{&} and @samp{|}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
327
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
328 @node Increment and decrement operators
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
329 @section Increment and decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
330
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
331 @cindex Increment operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
332 @cindex Decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
333 @cindex Operators, increment
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
334 @cindex Operators, decrement
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
335
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
336 Octave includes the C-like increment and decrement operators @samp{++}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
337 and @samp{--} in both their prefix and postfix forms.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
338
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
339 For example, to pre-increment the variable @var{x}, you would write
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
340 @code{++@var{x}}. This would add one to @var{x} and then return the new
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
341 value of @var{x} as the result of the expression. It is exactly the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
342 same as the expression @code{@var{x} = @var{x} + 1}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
343
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
344 To post-increment a variable @var{x}, you would write @code{@var{x}++}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
345 This adds one to the variable @var{x}, but returns the value that
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
346 @var{x} had prior to incrementing it. For example, if @var{x} is equal
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
347 to 2, the result of the expression @code{@var{x}++} is 2, and the new
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
348 value of @var{x} is 3.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
349
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
350 For matrix and vector arguments, the increment and decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
351 work on each element of the operand.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
352
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
353 It is not currently possible to increment index expressions. For
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
354 example, you might expect that the expression @code{@var{v}(4)++} would
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
355 increment the fourth element of the vector @var{v}, but instead it
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
356 results in a parse error. This problem may be fixed in a future
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
357 release of Octave.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
358
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
359 @node Unwind-protect
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
360 @section Unwind-protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
361
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
362 @cindex Unwind-protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
363
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
364 Octave supports a limited form of exception handling modelled after the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
365 unwind-protect form of Lisp. The general form of an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
366 @code{unwind_protect} block looks like this:
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
367
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
368 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
369 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
370 unwind_protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
371 @var{body}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
372 unwind_protect_cleanup
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
373 @var{cleanup}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
374 end_unwind_protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
375 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
376 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
377
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
378 @noindent
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
379 Where @var{body} and @var{cleanup} are both optional and may contain any
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
380 Octave expressions or commands. The statements in @var{cleanup} are
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
381 guaranteed to be executed regardless of how control exits @var{body}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
382
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
383 The @code{unwind_protect} statement is often used to reliably restore
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
384 the values of global variables that need to be temporarily changed.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
385
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
386 @node Variable-length argument lists
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
387 @section Variable-length argument lists
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
388
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
389 @cindex Variable-length argument lists
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
390 @cindex Argument lists, variable-length
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
391
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
392 Octave has a real mechanism for handling functions that take an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
393 unspecified number of arguments, so it is no longer necessary to place
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
394 an upper bound on the number of optional arguments that a function can
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
395 accept.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
396
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
397 Here is an example of a function that uses the new syntax to print a
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
398 header followed by an unspecified number of values:
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
399
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
400 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
401 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
402 function foo (heading, ...)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
403 disp (heading);
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
404 va_start ();
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
405 while (--nargin)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
406 disp (va_arg ());
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
407 endwhile
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
408 endfunction
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
409 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
410 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
411
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
412 Calling @code{va_start()} positions an internal pointer to the first
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
413 unnamed argument and allows you to cycle through the arguments more than
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
414 once. It is not necessary to call @code{va_start()} if you do not plan
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
415 to cycle through the arguments more than once.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
416
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
417 The function @code{va_arg()} returns the value of the next available
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
418 argument and moves the internal pointer to the next argument. It is an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
419 error to call @code{va_arg()} when there are no more arguments
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
420 available.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
421
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
422 It is also possible to use the keyword @var{all_va_args} to pass all
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
423 unnamed arguments to another function.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
424
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
425 @node Variable-length return lists
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
426 @section Variable-length return lists
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
427
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
428 @cindex Variable-length return lists
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
429 @cindex Return lists, variable-length
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
430
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
431 Octave also has a real mechanism for handling functions that return an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
432 unspecified number of values, so it is no longer necessary to place an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
433 upper bound on the number of outputs that a function can produce.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
434
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
435 Here is an example of a function that uses the new syntax to produce
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
436 @samp{N} values:
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
437
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
438 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
439 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
440 function [...] = foo (n)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
441 for i = 1:n
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
442 vr_val (i);
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
443 endfor
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
444 endfunction
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
445 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
446 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
447
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
448 @node Built-in ODE and DAE solvers
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
449 @section Built-in ODE and DAE solvers
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
450
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
451 @cindex DASSL
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
452 @cindex LSODE
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
453
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
454 Octave includes LSODE and DASSL for solving systems of stiff ordinary
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
455 differential and differential-algebraic equations. These functions are
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
456 built in to the interpreter.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
457
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
458 @node Documentation
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
459 @chapter What documentation exists for Octave?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
460
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
461 @cindex Octave, documentation
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
462
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
463 The Octave distribution includes a 220+ page manual that is also
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
464 distributed under the terms of the GNU GPL.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
465
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
466 The Octave manual is intended to be a complete reference for Octave, but
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
467 it is not a finished document. If you have problems using it, or find
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
468 that some topic is not adequately explained, indexed, or
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
469 cross-referenced, please send a bug report to bug-octave@@bevo.che.wisc.edu.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
470
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
471 Because the Octave manual is written using Texinfo, the complete text of
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
472 the Octave manual is also available on line using the GNU Info system
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
473 via the GNU Emacs, info, or xinfo programs, or by using the @samp{help -i}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
474 command to start the GNU info browser directly from the Octave prompt.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
475
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
476 It is also possible to use your favorite WWW browser to read the Octave
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
477 manual by converting the Texinfo source to HTML using the
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
478 @code{texi2html} program.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
479
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
480 @node Getting Octave
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
481 @chapter Obtaining Source Code
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
482
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
483 @cindex Source code
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
484
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
485 @menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
486 * Octave for Unix::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
487 * Octave for other platforms::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
488 * latest versions::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
489 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
490
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
491 @node Octave for Unix
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
492 @section How do I get a copy of Octave for Unix?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
493
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
494 You can get Octave from a friend who has a copy, by anonymous FTP, or by
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
495 ordering a tape or CD-ROM from the Free Software Foundation (FSF).
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
496
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
497 @cindex Octave, ordering
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
498 @cindex Octave, getting a copy
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
499
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
500 Octave was not developed by the FSF, but the FSF does distribute Octave,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
501 and the developers of Octave support the efforts of the FSF by
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
502 encouraging users of Octave to order Octave on CD-ROM directly from
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
503 the FSF.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
504
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
505 The FSF is a nonprofit organization that distributes software and
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
506 manuals to raise funds for more GNU development. Buying a CD-ROM from
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
507 the FSF contributes directly to paying staff to develop GNU software.
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
508 CD-ROMs cost $240 if an organization is buying, or $60 if an individual
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
509 is buying.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
510
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
511 @cindex FSF [Free Software Foundation]
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
512 @cindex GNU [GNU's not unix]
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
513
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
514 For more information about ordering from the FSF, contact
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
515 gnu@@gnu.org, phone (617) 542-5942 or anonymous ftp the file
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
516 @file{/pub/gnu/GNUinfo/ORDERS} from ftp.gnu.org.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
517
3285
6929a31e7624 [project @ 1999-10-13 21:59:11 by jwe]
jwe
parents: 3154
diff changeset
518 @cindex FSF, contact <gnu@@gnu.org>
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
519 @cindex GNUware, anonymous FTP sites
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
520
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
521 If you are on the Internet, you can copy the latest distribution
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
522 version of Octave from the file @file{/pub/octave/octave-M.N.tar.gz}, on
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
523 the host @file{ftp.che.wisc.edu}. This tar file has been compressed
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
524 with GNU gzip, so be sure to use binary mode for the transfer. @samp{M}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
525 and @samp{N} stand for version numbers; look at a listing of the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
526 directory through ftp to see what version is available. After you
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
527 unpack the distribution, be sure to look at the files @file{README} and
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
528 @file{INSTALL}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
529
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
530 Binaries for several popular systems are also available. If you would
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
531 like help out by making binaries available for other systems, please
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
532 contact bug-octave@@bevo.che.wisc.edu.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
533
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
534 A list of user-visible changes since the last release is available in
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
535 the file @file{NEWS}. The file @file{ChangeLog} in the source
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
536 distribution contains a more detailed record of changes made since the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
537 last release.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
538
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
539 @node Octave for other platforms
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
540 @section How do I get a copy of Octave for (some other platform)?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
541
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
542 @cindex VMS support
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
543 @cindex VAX
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
544 @cindex MS-DOS support
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
545 @cindex Windows support
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
546 @cindex DJGPP
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
547 @cindex EMX
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
548 @cindex OS/2 support
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
549
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
550 Octave currently runs on Unix-like systems, OS/2, and Windows NT/95
3840
79474340b3a1 [project @ 2001-06-17 02:17:33 by jwe]
jwe
parents: 3285
diff changeset
551 (using the Cygwin tools from Red Hat). It should be possible
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
552 to make Octave work on other systems as well. If you are interested in
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
553 porting Octave to other systems, please contact
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
554 bug-octave@@bevo.che.wisc.edu.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
555
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
556 @node latest versions
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
557 @section What is the latest version of Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
558
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
559 @cindex Octave, version date
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
560
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
561 The latest version of Octave is 2.0.10, released February 6, 1998.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
562
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
563 @node Installation
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
564 @chapter Installation Issues and Problems
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
565
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
566 @cindex Octave, building
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
567
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
568 Octave requires approximately 125MB of disk storage to unpack and
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
569 compile from source (significantly less if you don't compile with
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
570 debugging symbols or create shared libraries). Once installed, Octave
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
571 requires approximately 65MB of disk space (again, considerably less if
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
572 you don't build shared libraries or the binaries and libraries do not
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
573 include debugging symbols).
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
574
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
575 @menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
576 * What else do I need?::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
577 * Other C++ compilers?::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
578 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
579
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
580 @node What else do I need?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
581 @section What else do I need?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
582
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
583 @cindex GNU gcc
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
584 @cindex GNU g++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
585 @cindex libg++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
586 @cindex GNU Make
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
587 @cindex Flex
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
588 @cindex GNU Bison
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
589
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
590 To compile Octave, you will need a recent version of GNU Make. You
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
591 will also need g++ 2.7.2 or later. Version 2.8.0 or egcs 1.0.x should
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
592 work. Later versions may work, but C++ is still evolving, so don't be
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
593 too surprised if you run into some trouble.
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
594
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
595 It is no longer necessary to have libg++, but you do need to have the
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
596 GNU implementation of libstdc++. If you are using g++ 2.7.2,
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
597 libstdc++ is distributed along with libg++, but for later versions,
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
598 libstdc++ is distributed separately. For egcs, libstdc++ is included
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
599 with the compiler distribution.
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
600
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
601 <em>You must have gnu make to compile octave</em>. Octave's Makefiles
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
602 use features of GNU Make that are not present in other versions of make.
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
603 GNU Make is very portable and easy to install.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
604
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
605 @node Other C++ compilers?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
606 @section Can I compile Octave with another C++ compiler?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
607
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
608 Currently, Octave can only be compiled with the GNU C++ compiler. It
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
609 would be nice to make it possible to compile Octave with other C++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
610 compilers, but the maintainers do not have sufficient time to devote to
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
611 this. If you are interested in working to make Octave portable to other
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
612 compilers, please contact bug-octave@@bevo.che.wisc.edu.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
613
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
614 @node Common problems
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
615 @chapter Common problems
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
616
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
617 This list is probably far too short. Feel free to suggest additional
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
618 questions (preferably with answers!)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
619
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
620 @itemize @bullet
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
621 @item
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
622 Octave takes a long time to find symbols.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
623
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
624 Octave is probably spending this time recursively searching directories
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
625 for function files. Check the value of your LOADPATH. For those
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
626 elements that end in @samp{//}, do any name a very large directory tree?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
627 Does it contain directories that have a mixture of files and
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
628 directories? In order for the recursive directory searching code to
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
629 work efficiently, directories that are to be searched recursively should
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
630 have either function files only, or subdirectories only, but not a
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
631 mixture of both. Check to make sure that Octave's standard set of
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
632 function files is installed this way.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
633 @end itemize
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
634
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
635 @node Getting additional help
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
636 @chapter Getting additional help
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
637
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
638 @cindex Additional help
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
639 @cindex Mailing lists, help-octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
640
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
641 The mailing list
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
642
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
643 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
644 help-octave@@bevo.che.wisc.edu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
645 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
646
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
647 @noindent
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
648 is available for questions related to using, installing, and porting
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
649 Octave that are not adequately answered by the Octave manual or by this
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
650 document.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
651
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
652 If you would like to join the discussion and receive all messages sent
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
653 to the list, please send a short note to
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
654
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
655 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
656 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
657 help-octave-request@@bevo.che.wisc.edu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
658 ^^^^^^^
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
659 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
660 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
661
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
662 @strong{Please do not} send requests to be added or removed from the the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
663 mailing list, or other administrative trivia to the list itself.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
664
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
665 An archive of old postings to the help-octave mailing list is maintained
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
666 on ftp.che.wisc.edu in the directory @file{/pub/octave/MAILING-LISTS}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
667
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
668 @node Bug reports
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
669 @chapter I think I have found a bug in Octave.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
670
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
671 @cindex Bug in Octave, newly found
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
672
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
673 ``I think I have found a bug in Octave, but I'm not sure. How do I know,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
674 and who should I tell?''
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
675
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
676 @cindex Manual, for Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
677
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
678 First, see the section on bugs and bug reports in the Octave manual.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
679 The Octave manual is included in the Octave distribution.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
680
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
681 When you report a bug, make sure to describe the type of computer you
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
682 are using, the version of the operating system it is running, and the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
683 version of Octave that you are using. Also provide enough code so that
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
684 the Octave maintainers can duplicate your bug.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
685
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
686 If you have Octave working at all, the easiest way to do this is to use
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
687 the Octave function @code{bug_report}. When you execute this function,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
688 Octave will prompt you for a subject and then invoke the editor on a
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
689 file that already contains all the configuration information. When you
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
690 exit the editor, Octave will mail the bug report for you.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
691
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
692 @cindex Octave bug report
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
693 @cindex Mailing lists, bug-octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
694
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
695 If for some reason you cannot use Octave's @code{bug_report} function,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
696 mail your bug report to "bug-octave@@bevo.che.wisc.edu". Your message
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
697 needs to include enough information to allow the maintainers of Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
698 to fix the bug. Please read the section on bugs and bug reports in the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
699 Octave manual for a list of things that should be included in every bug
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
700 report.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
701
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
702 @node MATLAB compatibility
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
703 @chapter Porting programs from @sc{Matlab} to Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
704
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
705 @cindex @sc{Matlab} compatibility
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
706 @cindex Compatibility with @sc{Matlab}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
707
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
708 ``I wrote some code for @sc{Matlab}, and I want to get it running under
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
709 Octave. Is there anything I should watch out for?''
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
710
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
711 The differences between Octave and @sc{Matlab} typically fall into one of
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
712 three categories:
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
713
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
714 @enumerate
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
715 @item
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
716 Irrelevant.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
717
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
718 @item
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
719 Known differences, perhaps configurable with a user preference variable.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
720
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
721 @item
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
722 Unknown differences.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
723 @end enumerate
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
724
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
725 The first category, irrelevant differences, do not affect computations
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
726 and most likely do not affect the execution of function files.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
727
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
728 The differences of the second category are usually because the authors
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
729 of Octave decided on a better (subjective) implementation that the way
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
730 @sc{Matlab} does it, and so introduced ``user preference variables'' so that
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
731 you can customize Octave's behavior to be either @sc{Matlab}-compatible or
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
732 to use Octave's new features. To make Octave more @sc{Matlab}-compatible,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
733 put the following statements in your @file{~/.octaverc} file, or use the
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
734 command line option @samp{--traditional}, which implies all of these
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
735 settings. Note that this list may not be complete, because some new
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
736 variables may have been introduced since this document was last updated.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
737
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
738 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
739 @group
4455
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
740 PS1 = ">> "
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
741 PS2 = ""
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
742 beep_on_error = true
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
743 crash_dumps_octave_core = false
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
744 default_save_format = "mat-binary"
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
745 fixed_point_format = true
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
746 page_screen_output = false
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
747 print_empty_dimensions = false
abbf63293766 [project @ 2003-07-11 01:01:16 by jwe]
jwe
parents: 4452
diff changeset
748 warn_function_name_clash = false
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
749 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
750 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
751
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
752 Some other known differences are:
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
753
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
754 @itemize @bullet
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
755 @item
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
756 The Octave plotting functions are mostly compatible with the ones from
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
757 @sc{Matlab} 3.x, but not from @sc{Matlab} 4.x.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
758 @end itemize
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
759
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
760 The third category of differences is (hopefully) shrinking. If you find
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
761 a difference between Octave behavior and @sc{Matlab}, then you should send a
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
762 description of this difference (with code illustrating the difference,
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
763 if possible) to bug-octave@@bevo.che.wisc.edu.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
764
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
765 An archive of old postings to the Octave mailing lists is maintained
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
766 on ftp.che.wisc.edu in the directory @file{/pub/octave/MAILING-LISTS}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
767
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
768 @node Index
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
769 @appendix Concept Index
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
770
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
771 @printindex cp
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
772
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
773 @page
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
774 @contents
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
775 @bye