annotate doc/faq/OctaveFAQ.texi @ 9794:0d4613a736e9

convert build system to use automake and libtool
author John W. Eaton <jwe@octave.org>
date Tue, 10 Nov 2009 15:02:25 -0500
parents doc/faq/Octave-FAQ.texi@16f53d29049f
children fd0a3ac60b0e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9245
16f53d29049f update copyright notices
John W. Eaton <jwe@octave.org>
parents: 9076
diff changeset
1 % Copyright (C) 1997, 1998, 1999, 2001, 2003, 2004, 2005, 2007, 2008, 2009
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8334
diff changeset
2 % John W. Eaton
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
3 %
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
4 % This file is part of Octave.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
5 %
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
6 % Octave is free software; you can redistribute it and/or modify it
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
7 % under the terms of the GNU General Public License as published by the
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
8 % Free Software Foundation; either version 3 of the License, or (at
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
9 % your option) any later version.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
10 %
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
11 % Octave is distributed in the hope that it will be useful, but WITHOUT
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
12 % ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
13 % FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
14 % for more details.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
15 %
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
16 % You should have received a copy of the GNU General Public License
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
17 % along with Octave; see the file COPYING. If not, see
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
18 % <http://www.gnu.org/licenses/>.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
19
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
20 \input texinfo.tex @c -*-texinfo-*-
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
21
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9245
diff changeset
22 @setfilename OctaveFAQ.info
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
23 @settitle Frequently asked questions about Octave (with answers)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
24
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
25 @setchapternewpage off
5099
f7e39f977fe8 [project @ 2004-12-24 19:06:01 by jwe]
jwe
parents: 5041
diff changeset
26 @direntry
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9245
diff changeset
27 * OctaveFAQ: (OctaveFAQ). Frequently asked questions about Octave
5099
f7e39f977fe8 [project @ 2004-12-24 19:06:01 by jwe]
jwe
parents: 5041
diff changeset
28 @end direntry
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
29 @titlepage
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
30 @title Octave FAQ
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
31 @subtitle Frequently asked questions about Octave
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
32 @subtitle September 2008
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
33 @sp 1
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
34 @author John W. Eaton and David Bateman
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
35 @page
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
36 @end titlepage
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
37
5423
6cd1c2fc4dab [project @ 2005-07-28 19:27:57 by jwe]
jwe
parents: 5099
diff changeset
38 @ifnottex
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
39 @node Top
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
40 @top
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
41 @unnumbered Preface
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
42 @cindex FAQ for Octave, latest version
5423
6cd1c2fc4dab [project @ 2005-07-28 19:27:57 by jwe]
jwe
parents: 5099
diff changeset
43 @end ifnottex
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
44
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
45 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
46
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
47 We are always looking for new questions (@emph{with} answers), better
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
48 answers, or both. Please send suggestions to @email{bug@@octave.org}.
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
49 If you have general questions about Octave, or need help for something
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
50 that is not covered by the Octave manual or the FAQ, please use the
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
51 @email{help@@octave.org} mailing list.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
52
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
53 This FAQ is intended to supplement, not replace, the Octave manual.
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
54 Before posting a question to the @email{help@@octave.org} mailing list,
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
55 you should first check to see if the topic is covered in the manual.
2866
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 @menu
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
58 * What is Octave?::
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
59 * Licensing Issues::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
60 * How can I cite Octave?::
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
61 * Series 3.0.N::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
62 * Octave Features::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
63 * Learning more about Octave::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
64 * Getting Octave::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
65 * Installation::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
66 * Common problems::
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
67 * How do I ...?::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
68 * MATLAB compatibility::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
69 * Index::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
70 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
71
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
72 @node What is Octave?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
73 @chapter What is Octave?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
74
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
75 Octave is a high-level interactive language, primarily intended for
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
76 numerical computations that is mostly compatible with
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
77 @sc{Matlab}.@footnote{@sc{Matlab} is a registered trademark of The MathWorks,
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
78 Inc.}
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
79
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
80 Octave can do arithmetic for real, complex or integer-valued scalars
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
81 and matrices, solve sets of nonlinear algebraic equations, integrate
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
82 functions over finite and infinite intervals, and integrate systems of
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
83 ordinary differential and differential-algebraic equations.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
84
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
85 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
86 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
87 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
88 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
89 command history is saved, so that commands entered during previous
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
90 sessions are not lost.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
91
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
92 The Octave distribution includes a 590+ page Texinfo manual. Access
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
93 to the complete text of the manual is available via the help command
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
94 @c really, the *complete* text?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
95 at the Octave prompt.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
96
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
97 @menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
98 * Who develops Octave?::
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
99 * Why GNU Octave?::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
100 * What version should I use?::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
101 * On what platforms does Octave run?::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
102 @end menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
103
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
104 @node Who develops Octave?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
105 @section Who develops Octave?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
106
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
107 Discussions about writing the software that would eventually become
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
108 Octave started in about 1988 with James B. Rawlings and John W. Eaton at
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
109 the University of Texas. John W. Eaton was the original author of
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
110 Octave, starting full-time development in February 1992. He is still
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
111 the primary maintainer. The community
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
112 of users/developers has in addition contributed some code and fuels the
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
113 discussion on the mailing lists @email{help@@octave.org} (user forum),
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
114 @email{bug@@octave.org} (bug reports), @email{maintainers@@octave.org}
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
115 (development issues), and @email{octave-dev@@lists.sourceforge.net} (all
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
116 things related to the Octave Forge repository of user-contributed
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
117 functions).
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
118
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
119 @node Why GNU Octave?
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
120 @section Why GNU Octave?
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
121
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
122 The GNU Project was launched in 1984 to develop a complete Unix-like
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
123 operating system which is free software: the GNU system.
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
124
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
125 GNU is a recursive acronym for ``GNU's Not Unix''; it is pronounced
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
126 guh-noo, approximately like canoe.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
127
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
128 The Free Software Foundation (FSF) is the principal organizational
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
129 sponsor of the GNU Project.
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
130
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
131 Octave became GNU Octave in 1997 (beginning with version 2.0.6). This
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
132 meant agreeing to consider Octave a part of the GNU Project and support
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
133 the efforts of the FSF. However, Octave is not and has never been
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
134 developed by the FSF.
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
135
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
136 For more information about the GNU project, see @url{www.gnu.org}.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
137
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
138 @cindex FSF [Free Software Foundation]
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
139 @cindex GNU [GNU's not unix]
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
140
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
141 @node What version should I use?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
142 @section What version should I use?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
143
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
144 In general, you will find the latest version on
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
145 @url{http://www.octave.org/download.html}. It is
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
146 recommended to use the ``testing'' version of octave for general use,
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
147 and the ``development'' version if you want the latest features.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
148
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
149 A list of user-visible changes since the last release is available in
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
150 the file @file{NEWS}. The file @file{ChangeLog} in the source
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
151 distribution contains a more detailed record of changes made since the
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
152 last release.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
153
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
154 @node On what platforms does Octave run?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
155 @section On what platforms does Octave run?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
156
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
157 Octave runs on various Unices---at least Linux and Solaris, Mac OS X,
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
158 Windows and anything you can compile it on. Binary distributions exist
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
159 at least for Debian, Suse, Fedora and RedHat Linuxes (Intel and AMD
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
160 CPUs, at least), for Mac Os X and Windows' 98, 2000 and XP.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
161
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
162 Two and three dimensional plotting is fully supported using gnuplot.
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 The underlying numerical solvers are currently standard Fortran ones
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
165 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
166 of C++ classes. If possible, the Fortran subroutines are compiled
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
167 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
168 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
169 you have the free Fortran to C translator f2c.
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 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
172 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
173 Free Software Foundation.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
174
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
175 @node Licensing Issues
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
176 @chapter Licensing Issues
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
177
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
178 @menu
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
179 * If I write code using Octave do I have to release it under the GPL?: GPL
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
180 * Since the MEX interface allows plugins to be distributed under terms that are incompatible with the GPL, does this mean that you are encouraging people to to write non-free software for Octave?: Licensing MEX Files
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
181 * I wrote a program that links with Octave libraries and I don't want to release it under the terms of the GPL. Will you change the license of the Octave libraries for me?: Requesting License Changes
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
182 @end menu
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
183
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
184 @node GPL
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
185 @section If I write code using Octave do I have to release it under the GPL?
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
186
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
187 The answer depends on precisely how the code is written and how it works.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
188
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
189 Code written entirely in the scripting language of Octave
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
190 (interpreted code in .m files) may be released under the terms of
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
191 whatever license you choose.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
192
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
193 Code written using Octave's native plug-in interface (also known
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
194 as a .oct file) necessarily links with Octave internals and is
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
195 considered a derivative work of Octave and therefore must be
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
196 released under terms that are compatible with the GPL.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
197
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
198 Code written using Octave's implementation of the Matlab MEX
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
199 interface may be released under the terms of whatever license you
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
200 choose, provided that the following conditions are met:
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
201
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
202 @enumerate
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
203 @item
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
204 The plugin should not use any bindings that are specific to Octave. In
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
205 other words, the MEX file must use the MEX interface only, and not also
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
206 call on other Octave internals. It should be possible in principle to
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
207 use the MEX file with other programs that implement the MEX interface
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
208 (e.g., Matlab).
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
209
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
210 @item
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
211 The MEX file should not be distributed together with Octave in such a
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
212 way that they effectively create a single work. For example, you should
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
213 not distribute the MEX file and Octave together in a single package such
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
214 that Octave automatically loads and runs the MEX file when it starts up.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
215 There are other possible ways that you might effectively create a single
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
216 work; this is just one example.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
217 @end enumerate
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
218
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
219 A program that embeds the Octave interpreter (e.g., by calling the
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
220 "octave_main" function), or that calls functions from Octave's
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
221 libraries (e.g., liboctinterp, liboctave, or libcruft) is
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
222 considered a derivative work of Octave and therefore must be
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
223 released under terms that are compatible with the GPL.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
224
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
225 @node Licensing MEX Files
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
226 @section Since the MEX interface allows plugins to be distributed under terms that are incompatible with the GPL, does this mean that you are encouraging people to to write non-free software for Octave?
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
227
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
228 No. The original reason for implementing the MEX interface for Octave
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
229 was to allow Octave to run free software that uses MEX files (the
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
230 particular goal was to run SundialsTB in Octave). The intent was to
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
231 liberate that software from Matlab and increase the amount of free
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
232 software available to Octave users, not to enable people to write
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
233 proprietary code for Octave. For the good of the community, we strongly
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
234 encourage users of Octave to release the code they write for Octave
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
235 under terms that are compatible with the GPL.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
236
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
237 @node Requesting License Changes
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
238 @section I wrote a program that links with Octave libraries and I don't want to release it under the terms of the GPL. Will you change the license of the Octave libraries for me?
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
239
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
240 No. Instead of asking us to change the licensing terms for Octave, we
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
241 recommend that you release your program under terms that are compatible
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
242 with the GPL so that the free software community can benefit from your
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
243 work the same as you have benefitted from the work of all the people who
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
244 have contributed to Octave.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
245
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
246 @node How can I cite Octave?
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
247 @chapter How can I cite Octave?
4831
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
248
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
249 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
250 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
251 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
252 reference, then you can cite the Octave manual:
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
253
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
254 @example
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
255 @group
8334
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
256 @@BOOK@{eaton:2008,
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
257 author = "John W. Eaton and David Bateman and Søren Hauberg",
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
258 title = "GNU Octave Manual Version 3",
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
259 publisher = "Network Theory Limited",
8334
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
260 year = "2008",
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
261 isbn = "0-9546120-6-X"
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
262 @}
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
263 @end group
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
264 @end example
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
265
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
266 @node Series 3.0.N
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
267 @chapter What's new in version series 3.0.N and 3.1.N of Octave
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
268
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
269 The 3.0.N series has enough new features to justify a major version
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
270 number change. The 3.0.N series brings
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
271
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
272 @itemize @bullet
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
273
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
274 @item integer types
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
275
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
276 @item fixed point arithmetic
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
277
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
278 @item sparse matrices
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
279
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
280 @item Linear programming code based on GLPK
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
281
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
282 @item 64-bit compilation support
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
283
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
284 @item gzipped files and stream and consequently support of matlab v7 files
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
285
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
286 @item better support for both msvc and mingw
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
287
7116
c7992b210874 [project @ 2007-11-07 15:49:37 by jwe]
jwe
parents: 7018
diff changeset
288 @item a fully compatible MEX interface
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
289
6606
2c19eaa2c6f7 [project @ 2007-05-07 17:09:38 by jwe]
jwe
parents: 6584
diff changeset
290 @item many many other minor features and compatibility changes
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
291
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
292 @end itemize
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
293
6735
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
294 Here are some features that have been around since 2.1.N
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
295
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
296 @itemize @bullet
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
297
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
298 @item NDarrays
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
299
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
300 @item cells
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
301
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
302 @end itemize
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
303
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
304 The 3.1.N series is the current development release and will become a
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
305 3.2.N release in the future. This series brings the new features
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
306
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
307 @itemize
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
308 @item OpenGL backend
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
309
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
310 An experimental OpenGL graphics backend to replace the gnuplot
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
311
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
312 @item Object Orient Programming
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
313
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
314 @item Block comments
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
315
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
316 @item imwrite and imread
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
317
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
318 The functions are based on the GraphicsMagick library.
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
319
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
320 @item Lazy transpose
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
321
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
322 Special treatment in the parser of things like "a' * b", where the
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
323 transpose is never explicitly formed but a flag is rather passed to the
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
324 underlying LAPACK code.
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
325
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
326 @item Single precision type
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
327
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
328 @item Improved array indexing
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
329 The underlying code used for indexing of arrays has been completely
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
330 rewritten and so the indexing of arrays is now significantly faster.
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
331 @end itemize
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
332
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
333
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
334 @node Octave Features
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
335 @chapter What features are unique to Octave?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
336
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
337 @menu
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
338 * Functions defined on the command-line::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
339 * Comments with #::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
340 * Strings delimitted by double quotes "::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
341 * Line continuation by backslash::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
342 * Informative block closing::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
343 * Coherent syntax::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
344 * Exclamation mark as not operator::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
345 * Increment and decrement operators::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
346 * Unwind-protect::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
347 * Built-in ODE and DAE solvers::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
348 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
349
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
350 This section refers to Matlab R2008b and Octave 2.1.51.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
351
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
352 @node Functions defined on the command-line
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
353 @section Functions defined on the command-line
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
354
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
355 Functions can be defined by entering code on the command line, a
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
356 feature not supported by the other leading brand. For example, you may
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
357 type:
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
358
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
359 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
360 @group
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
361 octave:1> function s = hello_string (to_who)
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
362 > ## Say hello
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
363 > if nargin<1, to_who = "World"; end
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
364 > s = ["Hello ",\
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
365 > to_who];
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
366 > endfunction
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
367 octave:2> hello_string ("Moon")
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
368 ans = Hello Moon
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
369 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
370 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
371
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
372 @node Comments with #
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
373 @section Comments with #
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
374
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
375 The pound character, @samp{#}, may be used to start comments, in addition
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
376 to @samp{%}. See the previous example. The major advantage of this is
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
377 that as @samp{#} is also a comment character for unix script files, any
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
378 file that starts with a string like @samp{#! /usr/bin/octave -q} will be
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
379 treated as an octave script and be executed by octave.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
380
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
381 @node Strings delimitted by double quotes "
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
382 @section Strings delimitted by double quotes "
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
383 The double quote, @samp{"}, may be used to delimit strings, in addition to
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
384 the single quote @samp{'}. See the previous example. Also, double-quoted
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
385 strings include backslash interpretation (like C++, C, and Perl) while
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
386 single quoted are uninterpreted (like Matlab and Perl).
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
387
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
388 @node Line continuation by backslash
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
389 @section Line continuation by backslash
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
390
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
391 Lines can be continued with a backslash, @samp{\}, in addition to three
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
392 points @samp{@dots{}}. See the previous example.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
393
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
394 @node Informative block closing
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
395 @section Informative block closing
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
396
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
397 You may close @code{function}, @code{for}, @code{while}, @code{if},
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
398 @dots{} blocks with @code{endfunction}, @code{endfor}, @code{endwhile},
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
399 @dots{} keywords in addition to using @code{end}. As with Matlab, the
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
400 @code{end} (or @code{endfunction}) keyword that marks the end of a
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
401 function defined in a @file{.m} file is optional.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
402
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
403 @node Coherent syntax
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
404 @section Coherent syntax
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
405
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
406 Indexing other things than variables is possible, as in:
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
407 @example
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
408 @group
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
409 octave:1> [3 1 4 1 5 9](3)
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
410 ans = 4
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
411 octave:2> cos([0 pi pi/4 7])(3)
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
412 ans = 0.70711
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
413 @end group
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
414 @end example
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
415
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
416 @node Exclamation mark as not operator
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
417 @section Exclamation mark as not operator
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
418
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
419 The exclamation mark '!' (aka ``Bang!'') is a negation operator, just
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
420 like the tilde '~':
2866
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 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
423 @group
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
424 octave:1> if ! strcmp (program_name, "octave"),
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
425 > "It's an error"
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
426 > else
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
427 > "It works!"
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
428 > end
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
429 ans = It works!
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
430 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
431 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
432
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
433 @node Increment and decrement operators
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
434 @section Increment and decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
435
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
436 @cindex Increment operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
437 @cindex Decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
438 @cindex Operators, increment
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
439 @cindex Operators, decrement
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
440
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
441 If you like the @samp{++}, @samp{+=} etc operators, rejoice!
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
442 Octave includes the C-like increment and decrement operators @samp{++}
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
443 and @samp{--} in both their prefix and postfix forms, in addition to
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
444 @samp{+=}, @samp{-=}, @samp{*=}, @samp{/=}, @samp{^=}, @samp{.*=},
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
445 @samp{./=}, and @samp{.^=}.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
446
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
447 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
448 @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
449 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
450 same as the expression @code{@var{x} = @var{x} + 1}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
451
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
452 To post-increment a variable @var{x}, you would write @code{x++}.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
453 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
454 @var{x} had prior to incrementing it. For example, if @var{x} is equal
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
455 to 2, the result of the expression @code{x++} is 2, and the new
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
456 value of @var{x} is 3.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
457
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
458 For matrix and vector arguments, the increment and decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
459 work on each element of the operand.
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
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
462 @node Unwind-protect
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
463 @section Unwind-protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
464
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
465 @cindex Unwind-protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
466
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
467 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
468 unwind-protect form of Lisp. The general form of an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
469 @code{unwind_protect} block looks like this:
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 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
472 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
473 unwind_protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
474 @var{body}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
475 unwind_protect_cleanup
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
476 @var{cleanup}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
477 end_unwind_protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
478 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
479 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
480
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
481 @noindent
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
482 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
483 Octave expressions or commands. The statements in @var{cleanup} are
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
484 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
485
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
486 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
487 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
488
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
489 Matlab can be made to do something similar with their @code{OnCleanUp}
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
490 function that was introduced in 2008a.
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
491
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
492 @node Built-in ODE and DAE solvers
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
493 @section Built-in ODE and DAE solvers
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
494
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
495 @cindex DASSL
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
496 @cindex LSODE
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
497
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
498 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
499 differential and differential-algebraic equations. These functions are
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
500 built in to the interpreter.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
501
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
502 @node Learning more about Octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
503 @chapter What documentation exists for Octave?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
504
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
505 @menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
506 * Documentation::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
507 * Getting additional help::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
508 * User community::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
509 * Bug reports::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
510 @end menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
511
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
512
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
513 @node Documentation
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
514 @section What documentation exists for Octave?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
515
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
516 @cindex Octave, documentation
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
517
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
518 The Octave distribution includes a 590+ page manual that is also
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
519 distributed under the terms of the GNU GPL.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
520 It is available on the web at
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
521 @url{http://www.octave.org/docs.html} and you will also
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
522 find there instructions on how to order a paper version.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
523
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
524 The complete text of the Octave manual is also available using the GNU
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
525 Info system via the GNU Emacs, info, or xinfo programs, or by using
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
526 the @samp{help -i} command to start the GNU info browser directly from
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
527 the Octave prompt.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
528
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
529 If you have problems using this documentation, or find that some topic
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
530 is not adequately explained, indexed, or cross-referenced, please send
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
531 a bug report to @email{bug@@octave.org}.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
532
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
533
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
534 @node Getting additional help
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
535 @section Getting additional help
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
536
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
537 @cindex Additional help
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
538 @cindex Mailing lists, help-octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
539
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
540 If you can't find an answer to your question, the
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
541 @email{help@@octave.org} mailing list is available for questions related
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
542 to using, installing, and porting Octave that are not adequately
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
543 answered by the Octave manual or by this document.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
544
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
545 @node User community
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
546 @section User community
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
547
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
548 To subscribe to the list, go to @url{www.octave.org/archive.html} and
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
549 follow the link to the subscription page for the list.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
550
6653
673686daec87 [project @ 2007-05-22 15:36:09 by jwe]
jwe
parents: 6612
diff changeset
551 @strong{Please do not} send requests to be added or removed from the
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
552 mailing list, or other administrative trivia to the list itself.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
553
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
554 An archive of old postings to the help-octave mailing list is maintained
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
555 on @url{http://www.octave.org/archive.html}.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
556
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
557 You will also find some user advice and code spread over the web. Good
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
558 starting points are the Octave Wiki @url{http://wiki.octave.org} and
7483
fb66330b2608 don't special case SH_LD for FreeBSD and OpenBSD
John W. Eaton <jwe@octave.org>
parents: 7116
diff changeset
559 Octave-Forge @url{http://octave.sourceforge.net}
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
560
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
561 @node Bug reports
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
562 @section I think I have found a bug in Octave.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
563
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
564 @cindex Bug in Octave, newly found
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
565
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
566 ``I think I have found a bug in Octave, but I'm not sure. How do I know,
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
567 and who should I tell?''
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
568
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
569 @cindex Manual, for Octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
570
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
571 First, see the section on bugs and bug reports in the Octave manual.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
572 When you report a bug, make sure to describe the type of computer you
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
573 are using, the version of the operating system it is running, and the
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
574 version of Octave that you are using. Also provide enough code so that
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
575 the Octave maintainers can duplicate your bug.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
576
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
577 If you have Octave working at all, the easiest way to do this is to use
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
578 the Octave function @code{bug_report}. When you execute this function,
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
579 Octave will prompt you for a subject and then invoke the editor on a
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
580 file that already contains all the configuration information. When you
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
581 exit the editor, Octave will mail the bug report for you (in a unix-like
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
582 operating system).
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
584 @cindex Octave bug report
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
585 @cindex Mailing lists, bug-octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
586
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
587 If for some reason you cannot use Octave's @code{bug_report} function,
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
588 mail your bug report to @email{bug@@octave.org}. Your message needs to
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
589 include enough information to allow the maintainers of Octave to fix the
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
590 bug. Please read the section on bugs and bug reports in the Octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
591 manual for a list of things that should be included in every bug report.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
592
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
593
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
594 @node Getting Octave
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
595 @chapter Getting Octave
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
596
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
597 @menu
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
598 * Source code::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
599 * Pre-compiled binary packages::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
600 * Octave for other platforms::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
601 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
602
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
603 @node Source code
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
604 @section Source code
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
605 @cindex Source code
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
606
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
607 Source code is available on the Octave development site, where you are
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
608 sure to get the latest version.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
609
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
610 @itemize @bullet
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
611 @item @url{http://www.octave.org/download.html}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
612 @item @url{ftp://ftp.octave.org/pub/octave/}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
613 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
614
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
615 Since Octave is distrubted under the terms of the GPL, you can get
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
616 Octave from a friend who has a copy, by anonymous FTP, or by ordering
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
617 a tape or CD-ROM from the Free Software Foundation (FSF).
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
618
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
619 @node Pre-compiled binary packages
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
620 @section Pre-compiled binary packages
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
621 @cindex Pre-compiled binary packages
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
622 @cindex Binaries
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
623
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
624 The Octave project does not distribute binary packages, but other
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
625 projects do. For an up-to-date listing of packagers, see:
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
626
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
627 @itemize @bullet
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
628 @item @url{http://www.octave.org/download.html}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
629 @item @url{http://wiki.octave.org/wiki.pl?CategoryInstall}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
630 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
631
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
632 As of today, Octave binaries are available at least on Debian, RedHat,
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
633 Suse and Fedora Linuxes, Mac OS X, Windows' 98, 2000 and XP.
2866
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 Octave for other platforms
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
636 @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
637
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
638 @cindex VMS support
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
639 @cindex VAX
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
640 @cindex MS-DOS support
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
641 @cindex Windows support
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
642 @cindex DJGPP
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
643 @cindex EMX
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
644 @cindex OS/2 support
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
645
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
646 Octave currently runs on Unix-like systems, Mac OS X, and Windows.
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
647 It should be possible to make Octave work on other systems as well.
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
648 If you are interested in porting Octave to other systems, please contact
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
649 @email{bug@@octave.org}.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
650
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
651 @c @menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
652 @c * Octave for Unix::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
653 @c * Octave for other platforms::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
654 @c * latest versions::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
655 @c @end menu
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
656
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
657 @c @cindex Octave, ordering
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
658 @c @cindex Octave, getting a copy
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
659
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
660 @node Installation
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
661 @chapter Installation Issues and Problems
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
662
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
663 @cindex Octave, building
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
664
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
665 Octave 3.2 require approximately 800MB of disk storage to unpack
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
666 and compile from source (considerably less if you don't compile with
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
667 debugging symbols). Once installed, Octave requires approximately 200MB
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
668 of disk space (again, considerably less if you don't compile with
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
669 debugging symbols).
2866
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 @menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
672 * What else do I need?::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
673 * Other C++ compilers?::
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
674 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
675
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
676 @node What else do I need?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
677 @section What else do I need?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
678
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
679 @cindex GNU gcc
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
680 @cindex GNU g++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
681 @cindex libg++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
682 @cindex GNU Make
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
683 @cindex Flex
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
684 @cindex GNU Bison
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
685
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
686 To compile Octave, you will need a recent version of GNU Make. You
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
687 will also need GCC 3.3 or later, although GCC 4.1 or later is
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
688 recommended.
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
689
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
690 @strong{You must have GNU Make to compile octave}. Octave's Makefiles
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
691 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
692 GNU Make is very portable and easy to install.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
693
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
694 @node Other C++ compilers?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
695 @section Can I compile Octave with another C++ compiler?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
696
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
697 Yes, but development is done primarily with GCC, so you may hit some
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
698 incompatibilities. Octave is intended to be portable to any standard
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
699 conforming compiler. If you have difficulties that you think are bugs,
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
700 please report them to the @email{bug@@octave.org} mailing list, or ask
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
701 for help on the @email{help@@octave.org} mailing list.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
702
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
703 @node Common problems
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
704 @chapter Common problems
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
705
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
706 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
707 questions (preferably with answers!)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
708
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
709 @itemize @bullet
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
710 @item
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
711 Octave takes a long time to find symbols.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
712
6606
2c19eaa2c6f7 [project @ 2007-05-07 17:09:38 by jwe]
jwe
parents: 6584
diff changeset
713 Octave uses the @code{genpath} function to recursively add directories
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
714 to the list of directories searched for function files. Check the list
6606
2c19eaa2c6f7 [project @ 2007-05-07 17:09:38 by jwe]
jwe
parents: 6584
diff changeset
715 of directories with the @code{path} command. If the path list is very
2c19eaa2c6f7 [project @ 2007-05-07 17:09:38 by jwe]
jwe
parents: 6584
diff changeset
716 long check your use of the @code{genpath} function.
6735
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
717
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
718 @item
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
719 When plotting Octave occasionally gives me errors like @samp{gnuplot> 9 0.735604
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
720 line 26317: invalid command}.
6735
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
721
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
722 There is a known bug in gnuplot 4.2 that can cause an off by one error
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
723 while piping data to gnuplot. The relevant gnuplot bug report can be
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
724 found at @url{http://sourceforge.net/tracker/index.php?func=detail&aid=1716556&group_id=2055&atid=102055}
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
725
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
726 If you have obtained your copy of Octave from a distribution please file
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
727 a bug report requesting that the fix reported in the above bug report be
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
728 included.
8215
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
729
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
730 @item
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
731 I cannot install a package. Octave complains about a missing @code{mkoctfile}.
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
732
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
733 Most distributions split Octave into several packages. The script
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
734 @code{mkoctfile} is then part of a separate package:
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
735 @itemize @minus
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
736 @item
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
737 Debian/Ubuntu
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
738
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
739 @code{aptitude install octave3.0-headers}
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
740
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
741 @item
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
742 Fedora
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
743
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
744 @code{yum install octave-devel}
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
745
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
746 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
747 @end itemize
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
748
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
749 @node How do I ...?
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
750 @chapter How do I ...?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
751
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
752 @menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
753 * How do I set the number of displayed decimals?::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
754 @end menu
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
755
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
756 @cindex Tips and tricks
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
757 @cindex How do I @dots{} ?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
758
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
759 @node How do I set the number of displayed decimals?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
760 @section How do I set the number of displayed decimals?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
761
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
762 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
763 @group
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
764 octave:1> format long
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
765 octave:2> pi
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
766 pi = 3.14159265358979
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
767 octave:3> format short
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
768 octave:4> pi
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
769 pi = 3.1416
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
770 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
771 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
772
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
773 @node MATLAB compatibility
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
774 @chapter Porting programs from @sc{Matlab} to Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
775
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
776 @cindex @sc{Matlab} compatibility
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
777 @cindex Compatibility with @sc{Matlab}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
778
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
779 People often ask
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
780
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
781 ``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
782 Octave. Is there anything I should watch out for?''
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
783
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
784 or alternatively
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
785
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
786 ``I wrote some code in Octave, and want to share it with @sc{Matlab}
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
787 users. Is there anything I should watch out for?''
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
788
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
789 which is not quite the same thing. There are still a number of
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
790 differences between Octave and @sc{Matlab}, however in general
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
791 differences between the two are considered as bugs. Octave might
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
792 consider that the bug is in @sc{Matlab} and do nothing about it, but
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
793 generally functionality is almost identical. If you find a difference
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
794 between Octave behavior and @sc{Matlab}, then you should send a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
795 description of this difference (with code illustrating the difference,
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
796 if possible) to @email{bug@@octave.org}.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
797
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
798 Furthermore, Octave adds a few syntactical extensions to Matlab that
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
799 might cause some issues when exchanging files between Matlab and Octave
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
800 users. As both Octave and @sc{Matlab} are under constant development the
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
801 information in this section is subject to change at anytime.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
802
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
803 You should also look at the page
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
804 @url{http://octave.sourceforge.net/packages.html} and
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
805 @url{http://octave.sourceforge.net/doc/} that has a function reference
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
806 that is up to date. You can use this function reference to see the
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
807 number of octave function that are available and their @sc{Matlab}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
808 compatibility.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
809
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
810 The major differences between Octave 3.2.N and @sc{Matlab} R2008a are:
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
811
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
812 @itemize @bullet
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
813 @item Nested Functions
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
814
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
815 Octave doesn't yet have nested functions. That is
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
816
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
817 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
818 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
819 function y = foo (x)
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
820 y = bar(x)
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
821 function y = bar (x)
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
822 y = @dots{};
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
823 end
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
824 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
825 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
826 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
827
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
828 There was discussion in Octave of having these even prior to @sc{Matlab},
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
829 and the decision was made not to have these in Octave at the time for
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
830 compatibility. The above written with sub-functions functions would be
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
831
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
832 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
833 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
834 function y = foo (x)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
835 y = bar(x)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
836 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
837 function y = bar (x)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
838 y = @dots{};
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
839 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
840 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
841 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
842
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
843 Now that @sc{Matlab} has recently introduced nested functions, Octave will
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
844 probably have them soon as well. Until then nested functions in Octave
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
845 are treated as sub-functions with the same scoping rules as
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
846 sub-functions.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
847
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
848 The authors of Octave consider the nested function scoping rules of
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
849 Matlab to be more problems than they are worth as they introduce
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
850 diffiult to find bugs as inadvertantly modifying a variable in a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
851 nested function that is also used in the parent is particularly easy.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
852
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
853 @item Differences in core syntax
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
854 There a few core @sc{Matlab} syntaxes that are not accepted by Octave,
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
855 these being
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
856
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
857 @itemize @bullet
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
858 @item
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
859 Some limitations on the use of function handles. The major difference is
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
860 related to nested function scoping rules (as above) and their use with
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
861 function handles.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
862
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
863 @item
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
864 Some limitations of variable argument lists on the LHS of an expression,
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
865 though the most common types are accepted.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
866
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
867 @item
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
868 @sc{Matlab} classdef object oriented programming is not yet supportted,
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
869 though work is underway and when development more on to Octave 3.3 this
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
870 will be included in teh development tree.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
871 @end itemize
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
872
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
873 @item Differences in core functions
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
874 A large number of the @sc{Matlab} core functions (ie those that are in
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
875 the core and not a toolbox) are implemented, and certainly all of the
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
876 commonly used ones. There are a few functions that aren't implemented,
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
877 for example @code{condest} or to do with specific missing Octave functionality
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
878 (gui, dll, java, activex, dde, web, and serial functions). Some of the
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
879 core functions have limitations that aren't in the @sc{Matlab}
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
880 version. For example the @code{sprandn} function can not force a
6735
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
881 particular condition number for the matrix like @sc{Matlab} can.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
882
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
883 @item Just-In-Time compiler
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
884 @sc{Matlab} includes a "Just-In-Time" compiler. This compiler allows the
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
885 acceleration of for-loops in @sc{Matlab} to almost native performance with
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
886 certain restrictions. The JIT must know the return type of all functions
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
887 called in the loops and so you can't include user functions in the loop
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
888 of JIT optimized loops. Octave doesn't have a JIT and so to some might
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
889 seem slower than @sc{Matlab}. For this reason you must vectorize your code as
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
890 much as possible. The MathWorks themselves have a good document
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
891 discussing vectorization at
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
892 @url{http://www.mathworks.com/support/tech-notes/1100/1109.html}.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
893
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
894 @item Compiler
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
895 On a related point, there is no Octave compiler, and so you can't
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
896 convert your Octave code into a binary for additional speed or
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
897 distribution. There is an example of how to do this at
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
898 @url{http://www.stud.tu-ilmenau.de/~rueckn/}, but this is a very early
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
899 example code and would need lots of work to complete it.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
900
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
901 @item Graphic Handles
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
902 Up to Octave 2.9.9 there was no support for graphic handles in Octave
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
903 itself. In the 3.2.N versions of Octave the support for graphics
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
904 handles is converging towards full compatibility. The @code{patch}
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
905 function is currently limited to 2-D patches, due to an underlying
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
906 limitation in gnuplot.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
907
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
908 @item GUI
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
909 There are no @sc{Matlab} compatible GUI functions. There are a number of
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
910 bindings from Octave to Tcl/Tk, Vtk and zenity included in the
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
911 Octave Forge project (@url{http://octave.sourceforge.net}) for example
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
912 that can be used for a GUI, but these are not @sc{Matlab}
7116
c7992b210874 [project @ 2007-11-07 15:49:37 by jwe]
jwe
parents: 7018
diff changeset
913 compatible. Work on a matlab compatible GUI is in an alpha stage in the
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
914 JHandles package (@url{http://octave.sourceforge.net/jhandles/index.html}).
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
915 This might be an issue if you intend to exchange Octave code with
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
916 @sc{Matlab} users.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
917
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
918 @item Simulink
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
919 Octave itself includes no Simulink support. Typically the simulink
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
920 models lag research and are less flexible, so shouldn't really be used
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
921 in a research environment. However, some @sc{Matlab} users that try to
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
922 use Octave complain about this lack. There is a similar package to
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
923 simulink for the Octave and R projects available at
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
924 @url{http://www.scicraft.org/}
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
925
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
926 @item Mex-Files
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
927 Octave includes an API to the matlab MEX interface. However, as MEX is
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
928 an API to the internals of @sc{Matlab} and the internals of Octave
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
929 differ from @sc{Matlab}, there is necessarily a manipulation of the data
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
930 to convert from a MEX interface to the Octave equivalent. This is
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
931 notable for all complex matrices, where @sc{Matlab} stores complex
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
932 arrays as real and imaginary parts, whereas Octave respects the C99/C++
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
933 standards of co-locating the real/imag parts in memory. Also due to the
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
934 way @sc{Matlab} allows access to the arrays passed through a pointer,
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
935 the MEX interface might require copies of arrays (even non complex
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
936 ones).
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
937
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
938 @item Block comments
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
939 Block comments denoted by "%@{" and "%@}" markers are supported by
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
940 Octave with some limitations. The major limitation is that block
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
941 comments are not supported within [] or @{@}.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
942
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
943 @item Mat-File format
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
944 There are some differences in the mat v5 file format accepted by
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
945 Octave. @sc{Matlab} recently introduced the "-V7.3" save option which is
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
946 an HDF5 format which is particularly useful for 64-bit platforms where
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
947 the standard matlab format can not correctly save variables.. Octave
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
948 accepts HDF5 files, but is not yet compatible with the "-v7.3" versions
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
949 produced by @sc{Matlab}.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
950
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
951 Although Octave can load inline abd function handles saved by
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
952 @sc{Matlab}, it can not yet save them.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
953
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
954 Finally, Some multi-byte unicode characters aren't yet treated in
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
955 mat-files.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
956
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
957 @item Profiler
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
958 Octave doesn't have a profiler. Though there is a patch for a flat
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
959 profiler, that might become a real profiler sometime in the future. see
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
960 the thread
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
961
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
962 @url{http://www.cae.wisc.edu/pipermail/octave-maintainers/2007-January/001685.html}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
963
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
964 for more details
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
965
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
966 @item Toolboxes
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
967 Octave is a community project and so the toolboxes that exist are
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
968 donated by those interested in them through the Octave Forge website
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
969 (@url{http://octave.sourceforge.net}). These might be lacking in certain
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
970 functionality relative to the @sc{Matlab} toolboxes, and might not
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
971 exactly duplicate the matlab functionality or interface.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
972
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
973 @item Short-circuit & and | operators
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
974 The @code{&} and @code{|} operators in @sc{Matlab} short-circuit when
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
975 included in an if statemant and not otherwise. In Octave only the
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
976 @code{&&} and @code{||} short circuit. Note that this means that
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
977
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
978 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
979 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
980 if (a | b)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
981 @dots{}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
982 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
983 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
984 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
985
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
986 and
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
987
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
988 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
989 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
990 t = a | b;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
991 if t
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
992 @dots{}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
993 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
994 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
995 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
996
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
997 @noindent
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
998 are different in @sc{Matlab}. This is really a @sc{Matlab} bug, but
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
999 there is too much code out there that relies on this behavior to change
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1000 it. Prefer the || and && operators in if statements if possible.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1001
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1002 Note that the difference is also significant when either argument is a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1003 function with side effects or if the first argument is a scalar and the
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1004 second argument is an empty matrix. For example, note the difference
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1005 between
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1006
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1007 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1008 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1009 t = 1 | []; ## results in [], so...
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1010 if (t) 1, end ## in if ([]), this is false.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1011 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1012 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1013
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1014 and
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1015
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1016 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1017 if (1 | []) 1, end ## short circuits so condition is true.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1018 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1019
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1020 Another case that is documented in the @sc{Matlab} manuals is that
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1021
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1022 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1023 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1024 t = [1, 1] | [1, 2, 3]; ## error
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1025 if ([1, 1] | [1, 2, 3]) 1, end ## OK
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1026 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1027 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1028
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1029 Also @sc{Matlab} requires the operands of && and || to be scalar values but
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1030 Octave does not (it just applies the rule that for an operand to be
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1031 considered true, every element of the object must be nonzero or
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1032 logically true).
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1033
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1034 Finally, note the inconsistence of thinking of the condition of an if
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1035 statement as being equivalent to @code{all(X(:))} when @var{X} is a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1036 matrix. This is true for all cases EXCEPT empty matrices:
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1037
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1038 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1039 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1040 if ([0, 1]) == if (all ([0, 1])) ==> i.e., condition is false.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1041 if ([1, 1]) == if (all ([1, 1])) ==> i.e., condition is true.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1042 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1043 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1044
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1045 However,
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1046
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1047 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1048 if ([]) != if (all ([]))
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1049 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1050
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1051 because @code{samp ([]) == 1} (because, despite the name, it is really
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1052 returning true if none of the elements of the matrix are zero, and since
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1053 there are no elements, well, none of them are zero). But, somewhere
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1054 along the line, someone decided that if @code{([])} should be false.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1055 Mathworks probably thought it just looks wrong to have @code{[]} be true
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1056 in this context even if you can use logical gymnastics to convince
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1057 yourself that "all" the elements of a matrix that doesn't actually have
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1058 any elements are nonzero. Octave however duplicates this behavior for if
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1059 statements containing empty matrices.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1060
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1061 @item Solvers for singular, under- and over-determined matrices
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1062
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1063 Matlab's solvers as used by the operators mldivide (\) and mrdivide (/),
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1064 use a different approach than Octave's in the case of singular, under-,
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1065 or over-determined matrices. In the case of a singular matrix, Matlab
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1066 returns the result given by the LU decomposition, even though the underlying
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1067 solver has flagged the result as erroneous. Octave has made the choice
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1068 of falling back to a minimum norm solution of matrices that have been
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1069 flagged as singular which arguably is a better result for these cases.
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1070
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1071 In the case of under- or over-determined matrices, Octave continues to
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1072 use a minimum norm solution, whereas Matlab uses an approach that is
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1073 equivalent to
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1074
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1075 @example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1076 @group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1077 function x = mldivide (A, b)
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1078 [Q, R, E] = qr(A);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1079 x = [A \ b, E(:, 1:m) * (R(:, 1:m) \ (Q' * b))]
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1080 end
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1081 @end group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1082 @end example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1083
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1084 @noindent
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1085 While this approach is certainly faster and uses less memory than
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1086 Octave's minimum norm approach, this approach seems to be inferior in
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1087 other ways.
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1088
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1089 A numerical question arises: how big can the null space component become,
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1090 relative to the minimum-norm solution? Can it be nicely bounded, or can it be
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1091 arbitrarily big? Consider this example:
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1092
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1093 @example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1094 @group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1095 m = 10;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1096 n = 10000;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1097 A = ones(m, n) + 1e-6 * randn(m,n);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1098 b = ones(m, 1) + 1e-6 * randn(m,1);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1099 norm(A \ b)
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1100 @end group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1101 @end example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1102
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1103 @noindent
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1104 while Octave's minimum-norm values are around 3e-2, Matlab's results
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1105 are 50-times larger. For another issue, try this code:
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1106
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1107 @example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1108 @group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1109 m = 5;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1110 n = 100;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1111 j = floor(m * rand(1, n)) + 1;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1112 b = ones(m, 1);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1113 A = zeros(m, n);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1114 A(sub2ind(size(A),j,1:n)) = 1;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1115 x = A \ b;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1116 [dummy,p] = sort(rand(1,n));
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1117 y = A(:,p)\b;
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1118 norm(x(p)-y)
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1119 @end group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1120 @end example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1121
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1122 @noindent
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1123 It shows that unlike in Octave, mldivide in Matlab is not invariant
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1124 with respect to column permutations. If there are multiple columns of
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1125 the same norm, permuting columns of the matrix gets you different
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1126 result than permuting the solution vector. This will surprise many
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1127 users.
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1128
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1129 Since the mldivide (\) and mrdivide (/) operators are often part of a more
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1130 complex expression, where there is no room to react to warnings or flags, it
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1131 should prefer intelligence (robustness) to speed, and so the Octave developers
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1132 are firmly of the opinion that Octave's approach for singular, under- and
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1133 over-determined matrices is a better choice that Matlab's
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1134
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1135 @item Octave extensions
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1136 The extensions in Octave over @sc{Matlab} syntax are
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1137 very useful, but might cause issues when sharing with @sc{Matlab} users.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1138 A list of the major extensions that should be avoided to be compatible
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1139 with @sc{Matlab} are
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1140
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1141 @itemize @bullet
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1142 @item
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1143 Comments in octave can be marked with @samp{#}. This allows POSIX
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1144 systems to have the first line as @samp{#! octave -q} and mark the script
6653
673686daec87 [project @ 2007-05-22 15:36:09 by jwe]
jwe
parents: 6612
diff changeset
1145 itself executable. @sc{Matlab} doesn't have this feature due to the
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1146 absence of comments starting with @samp{#}".
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1147
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1148 @item
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1149 Code blocks like if, for, while, etc can be terminated with block
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1150 specific terminations like "endif". @sc{Matlab} doesn't have this and
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1151 all blocks must be terminated with "end"
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1152
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1153 @item
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1154 Octave has a lisp like unwind_protect block that allows blocks of
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1155 code that terminate in an error to ensure that the variables that
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1156 are touched are restored. You can do something similar with
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1157 @code{try}/@code{catch} combined with @samp{rethrow (lasterror ())} in
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1158 @sc{Matlab}, however rethrow and lasterror are only available in Octave 2.9.10 and later.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1159
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1160 Note that using @code{try}/@code{catch} combined with @samp{rethrow
8325
b93ac0586e4b spelling corrections
Brian Gough<bjg@network-theory.co.uk>
parents: 8292
diff changeset
1161 (lasterror ())} can not guarantee that global variables will be
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1162 correctly reset, as it won't catch user interrupts with Ctrl-C. For
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1163 example
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1164
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1165 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1166 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1167 global a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1168 a = 1;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1169 try
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1170 _a = a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1171 a = 2
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1172 while true
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1173 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1174 catch
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1175 fprintf ('caught interrupt\n');
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1176 a = _a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1177 rethrow (lasterror());
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1178 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1179 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1180 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1181
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1182 @noindent
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1183 compared to
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1184
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1185 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1186 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1187 global a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1188 a = 1;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1189 unwind_protect
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1190 _a = a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1191 a = 2
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1192 while true
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1193 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1194 unwind_protect_cleanup
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1195 fprintf ('caught interrupt\n');
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1196 a = _a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1197 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1198 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1199 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1200
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1201 Typing Ctrl-C in the first case returns the user directly to the
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
1202 prompt, and the variable "a" is not reset to the saved value. In the
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1203 second case the variable "a" is reset correctly. Therefore @sc{Matlab}
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1204 gives no save way of temporarily changing global variables.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1205
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1206 @item
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1207 Indexing can be applied to all objects in Octave and not just
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1208 variable. Therefore @code{sin(x)(1:10);} for example is perfectly valid
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1209 in Octave but not @sc{Matlab}. To do the same in @sc{Matlab} you must do
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1210 @code{y = sin(x); y = y([1:10]);}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1211
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1212 @item
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1213 Octave has the operators "++", "--", "-=", "+=", "*=", etc. As
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1214 @sc{Matlab} doesn't, if you are sharing code these should be avoided.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1215
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1216 @item
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1217 Character strings in Octave can be denoted with double or single
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1218 quotes. There is a subtle difference between the two in that escaped
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1219 characters like @code{\n} (newline), @code{\t} (tab), etc are
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1220 interpreted in double quoted strings but not single quoted strings. This
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1221 difference is important on Windows platforms where the "\" character is
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1222 used in path names, and so single quoted strings should be used in
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1223 paths. @sc{Matlab} doesn't have double quoted strings and so they should
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1224 be avoided if the code will be transfered to a @sc{Matlab} user.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1225 @end itemize
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1226
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1227 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1228
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
1229 @node Index
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1230 @appendix Concept Index
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1231
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1232 @printindex cp
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1233
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1234 @page
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1235 @contents
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1236 @bye