annotate doc/faq/OctaveFAQ.texi @ 12704:da6cbb752368

maint: Periodic merge of stable to default branch.
author Rik <octave@nomad.inbox5.com>
date Sat, 04 Jun 2011 16:05:37 -0700
parents 0c956011c35c 013cd94d8d7f
children 72c96de7a403
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 9794
diff changeset
1 % Copyright (C) 1997-2011 John W. Eaton
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
2 %
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
3 % This file is part of Octave.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
4 %
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
5 % 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
6 % 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
7 % 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
8 % your option) any later version.
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
9 %
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
10 % 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
11 % 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
12 % 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
13 % for more details.
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
14 %
7018
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
15 % 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
16 % 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
17 % <http://www.gnu.org/licenses/>.
fd42779a8428 [project @ 2007-10-13 00:52:12 by jwe]
jwe
parents: 6900
diff changeset
18
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
19 \input texinfo.tex @c -*-texinfo-*-
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
20
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9245
diff changeset
21 @setfilename OctaveFAQ.info
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
22 @settitle Frequently asked questions about Octave (with answers)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
23
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
24 @setchapternewpage off
5099
f7e39f977fe8 [project @ 2004-12-24 19:06:01 by jwe]
jwe
parents: 5041
diff changeset
25 @direntry
9794
0d4613a736e9 convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents: 9245
diff changeset
26 * OctaveFAQ: (OctaveFAQ). Frequently asked questions about Octave
5099
f7e39f977fe8 [project @ 2004-12-24 19:06:01 by jwe]
jwe
parents: 5041
diff changeset
27 @end direntry
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
28 @titlepage
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
29 @title Octave FAQ
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
30 @subtitle Frequently asked questions about Octave
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
31 @subtitle @today{}
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
32 @sp 1
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
33 @author John W. Eaton and David Bateman
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
34 @page
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
35 @end titlepage
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
36
5423
6cd1c2fc4dab [project @ 2005-07-28 19:27:57 by jwe]
jwe
parents: 5099
diff changeset
37 @ifnottex
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
38 @node Top
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
39 @top
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
40 @unnumbered Preface
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
41 @cindex FAQ for Octave, latest version
5423
6cd1c2fc4dab [project @ 2005-07-28 19:27:57 by jwe]
jwe
parents: 5099
diff changeset
42 @end ifnottex
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
43
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
44 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
45
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
46 We are always looking for new questions (@emph{with} answers), better
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
47 answers, or both. Please send suggestions to
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
48 @url{http://bugs.octave.org}. If you have general questions about
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
49 Octave, or need help for something that is not covered by the Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
50 manual or the FAQ, please use the @email{help@@octave.org} mailing list.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
51
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
52 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
53 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
54 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
55
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
56 @menu
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
57 * What is Octave?::
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
58 * Licensing Issues::
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
59 * How can I cite Octave?::
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
60 * Series 3.4.N::
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
61 * Octave Features::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
62 * Learning more about Octave::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
63 * Getting Octave::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
64 * Installation::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
65 * Common problems::
12631
0c956011c35c OctaveFAQ.texi: Fix texinfo in FAQ I broke earlier
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12630
diff changeset
66 * Using Octave::
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
67 * @sc{Matlab} compatibility::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
68 * Index::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
69 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
70
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
71 @node What is Octave?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
72 @chapter What is Octave?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
73
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
74 Octave is a high-level interactive language, primarily intended for
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
75 numerical computations that is mostly compatible with
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
76 @sc{Matlab}.@footnote{@sc{Matlab} is a registered trademark of The
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
77 MathWorks, Inc.}
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
78
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
79 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
80 and matrices, solve sets of nonlinear algebraic equations, integrate
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
81 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
82 ordinary differential and differential-algebraic equations.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
83
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
84 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
85 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
86 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
87 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
88 command history is saved, so that commands entered during previous
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
89 sessions are not lost.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
90
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
91 The Octave distribution includes a 650+ page Texinfo manual. Access to
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
92 the complete text of the manual is available via the @code{doc} command
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
93 at the Octave prompt.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
94
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
95 @menu
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
96 * Who develops Octave?::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
97 * Why GNU Octave?::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
98 * What version should I use?::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
99 * On what platforms does Octave run?::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
100 @end menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
101
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
102 @node Who develops Octave?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
103 @section Who develops Octave?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
104
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
105 Discussions about writing the software that would eventually become
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
106 Octave started in about 1988 with James B. Rawlings and John W. Eaton at
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
107 the University of Texas. John W. Eaton was the original author of
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
108 Octave, starting full-time development in February 1992. He is still the
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
109 primary maintainer. The community of users/developers has in addition
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
110 contributed some code and fuels the discussion on the mailing lists
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
111 @email{help@@octave.org} (user forum), @email{maintainers@@octave.org}
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
112 (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
113 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
114 functions).
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
115
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
116 @node Why GNU Octave?
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
117 @section Why GNU Octave?
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 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
120 operating system which is free software: the GNU system.
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
121
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
122 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
123 guh-noo, approximately like canoe.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
124
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
125 The Free Software Foundation (FSF) is the principal organizational
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
126 sponsor of the GNU Project.
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
127
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
128 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
129 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
130 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
131 developed by the FSF.
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
132
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
133 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
134
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
135 @cindex FSF [Free Software Foundation]
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
136 @cindex GNU [GNU's not unix]
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 @node What version should I use?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
139 @section What version should I use?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
140
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
141 In general, you will find the latest version on
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
142 @url{http://www.octave.org/download.html}. It is recommended to use the
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
143 ``stable'' version of octave for general use, and the ``development''
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
144 version if you want the latest features.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
145
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
146 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
147 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
148 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
149 last release.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
150
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
151 @node On what platforms does Octave run?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
152 @section On what platforms does Octave run?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
153
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
154 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
155 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
156 at least for Debian, Suse, Fedora and RedHat Linuxes (Intel and AMD
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
157 @c Does Vista work? I get the feeling that even Windows users are trying
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
158 @c to forget Vista like a bad nightmare. Tatsuro only confirmed XP and
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
159 @c 7. I am tentatively assuming that Vista also works.
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
160 CPUs, at least), for Mac OS X and Windows' 98, 2000, XP, Vista, and 7.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
161
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
162 Two and three dimensional plotting is fully supported using gnuplot and
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
163 an experimental OpenGL backend.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
164
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
165 The underlying numerical solvers are currently standard Fortran ones
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
166 like LAPACK, LINPACK, ODEPACK, the BLAS, etc., packaged in a library
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
167 of C++ classes. If possible, the Fortran subroutines are compiled
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
168 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
169 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
170 you have the free Fortran to C translator f2c.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
171
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
172 Octave is also free software; you can redistribute it and/or modify it
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
173 under the terms of the GNU General Public License, version 3, as
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
174 published by the Free Software Foundation, or at your option any later
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
175 version.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
176
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
177 @node Licensing Issues
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
178 @chapter Licensing Issues
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
179
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
180 @menu
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
181 * 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
182 * 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
183 * 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
184 @end menu
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
185
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
186 @node GPL
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
187 @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
188
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
189 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
190
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
191 Code written entirely in the scripting language of Octave
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
192 (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
193 whatever license you choose.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
194
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
195 Code written using Octave's native plug-in interface (also known
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
196 as a .oct file) necessarily links with Octave internals and is
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
197 considered a derivative work of Octave and therefore must be
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
198 released under terms that are compatible with the GPL.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
199
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
200 Code written using Octave's implementation of the @sc{Matlab} MEX
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
201 interface may be released under the terms of whatever license you
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
202 choose, provided that the following conditions are met:
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
203
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
204 @enumerate
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
205 @item
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
206 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
207 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
208 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
209 use the MEX file with other programs that implement the MEX interface
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
210 (e.g., @sc{Matlab}).
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
211
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
212 @item
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
213 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
214 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
215 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
216 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
217 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
218 work; this is just one example.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
219 @end enumerate
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
220
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
221 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
222 "octave_main" function), or that calls functions from Octave's
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
223 libraries (e.g., liboctinterp, liboctave, or libcruft) is
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
224 considered a derivative work of Octave and therefore must be
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
225 released under terms that are compatible with the GPL.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
226
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
227 @node Licensing MEX Files
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
228 @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
229
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
230 No. The original reason for implementing the MEX interface for Octave
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
231 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
232 particular goal was to run SundialsTB in Octave). The intent was to
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
233 liberate that software from @sc{Matlab} and increase the amount of free
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
234 software available to Octave users, not to enable people to write
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
235 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
236 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
237 under terms that are compatible with the GPL.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
238
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
239 @node Requesting License Changes
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
240 @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
241
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
242 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
243 recommend that you release your program under terms that are compatible
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
244 with the GPL so that the free software community can benefit from your
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
245 work the same as you have benefited from the work of all the people who
9076
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
246 have contributed to Octave.
d5a4aa53f03a FAQ additions
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
247
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
248 @node How can I cite Octave?
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
249 @chapter How can I cite Octave?
4831
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
250
4ec7d24b4943 [project @ 2004-03-10 06:14:52 by jwe]
jwe
parents: 4830
diff changeset
251 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
252 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
253 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
254 reference, then you can cite the Octave manual:
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
255
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
256 @example
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
257 @group
8334
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
258 @@BOOK@{eaton:2008,
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
259 author = "John W. Eaton and David Bateman and Søren Hauberg",
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
260 title = "GNU Octave Manual Version 3",
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
261 publisher = "Network Theory Limited",
8334
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
262 year = "2008",
70dd33450061 Update manual citation
David Bateman <dbateman@free.fr>
parents: 8325
diff changeset
263 isbn = "0-9546120-6-X"
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
264 @}
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
265 @end group
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
266 @end example
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
267
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
268 @node Series 3.4.N
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
269 @chapter What's new in version series 3.4.N and 3.5.N of Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
270
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
271 The 3.4.N series has enough new features to justify a minor version
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
272 number change. The full details are in the @file{NEWS} file, but in
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
273 brief 3.4.N series brings:
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
274
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
275 @c This list is distilled from the NEWS file. Does it have enough
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
276 @c things? Does it have too many?
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
277 @itemize @bullet
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
278
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
279 @item ARPACK now distributed with Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
280
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
281 @item Indexing optimisations
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
282
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
283 @item FTP object using @file{libcurl}
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
284
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
285 @item Better consistency with ismatrix, issquare, and issymetric
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
286
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
287 @item Function handles aware of overloaded functions
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
288
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
289 @item More efficient matrix division by making a single LAPACK call
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
290
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
291 @item Other optimisations in matrix operations
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
292
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
293 @item @code{bsxfun} optimised for basic arithmetic functions
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
294
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
295 @item @sc{Matlab}-style ignoring of output arguments using @samp{~}
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
296
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
297 @item Many optimisations of the @code{accumarray} function
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
298
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
299 @item Sparse matrix indexing has been rewritten for speed
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
300
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
301 @item Configuration pseudo-variables like @code{page_screen_output}
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
302 accept a ``local'' option argument to limit their scope to function
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
303 scope
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
304
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
305 @item The @code{pkg} command now accepts a @code{-forge} option to pull
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
306 packages directly from Octave-forge
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
307
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
308 @item Several @code{dlmread} improvements
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
309
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
310 @item Octave now uses gnulib for better cross-platform compatibility
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
311
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
312 @end itemize
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
313
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
314 Here are some features that have been around since 3.2.N
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
315
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
316 @itemize @bullet
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
317
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
318 @item integer types
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
319
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
320 @item fixed point arithmetic
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
321
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
322 @item sparse matrices
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
323
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
324 @item Linear programming code based on GLPK
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
325
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
326 @item 64-bit compilation support
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
327
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
328 @item gzipped files and stream and consequently support of @sc{Matlab} v7 files
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
329
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
330 @item better support for both msvc and mingw
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
331
7116
c7992b210874 [project @ 2007-11-07 15:49:37 by jwe]
jwe
parents: 7018
diff changeset
332 @item a fully compatible MEX interface
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
333
6606
2c19eaa2c6f7 [project @ 2007-05-07 17:09:38 by jwe]
jwe
parents: 6584
diff changeset
334 @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
335
11576
8ac9687dbe9f rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
336 @item OpenGL graphics toolkit
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
337
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
338 An experimental OpenGL graphics toolkit to replace gnuplot.
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
339
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
340 @item Object Orient Programming
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
341
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
342 @item Block comments
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
343
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
344 @item imwrite and imread
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
345
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
346 The functions are based on the GraphicsMagick library.
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
347
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
348 @item Lazy transpose
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
349
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
350 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
351 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
352 underlying LAPACK code.
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
353
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
354 @item Single precision type
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
355
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
356 @item Improved array indexing
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
357 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
358 rewritten and so the indexing of arrays is now significantly faster.
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
359
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
360 @end itemize
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
361
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
362 Here are some older features that have been around since 2.1.N:
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
363
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
364 @itemize @bullet
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
365
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
366 @item NDarrays
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
367
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
368 @item cells
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
369
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
370 @end itemize
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
371
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
372 The 3.5.N series is the current development release and will become a
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
373 3.6.N release in the future. This series brings the following new
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
374 features:
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
375
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
376 @itemize
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
377 @item Perl-compatible regular expressions are now part of Octave
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
378 @end itemize
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
379
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
380
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
381 @node Octave Features
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
382 @chapter What features are unique to Octave?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
383
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
384 @menu
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
385 * Functions defined on the command-line::
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
386 * Comments with #::
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
387 * Strings delimited by double quotes "::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
388 * Line continuation by backslash::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
389 * Informative block closing::
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
390 * Coherent syntax::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
391 * Exclamation mark as not operator::
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
392 * Increment and decrement operators::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
393 * Unwind-protect::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
394 * Built-in ODE and DAE solvers::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
395 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
396
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
397 This section refers to @sc{Matlab} R2010b and Octave 3.4.0.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
398
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
399 @node Functions defined on the command-line
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
400 @section Functions defined on the command-line
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
401
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
402 Functions can be defined by entering code on the command line, a feature
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
403 not supported by @sc{Matlab}. For example, you may type:
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
404
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
405 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
406 @group
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
407 octave:1> function s = hello_string (to_who)
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
408 > ## Say hello
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
409 > if nargin<1, to_who = "World"; end
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
410 > s = ["Hello ",\
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
411 > to_who];
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
412 > endfunction
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
413 octave:2> hello_string ("Moon")
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
414 ans = Hello Moon
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
415 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
416 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
417
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
418 @node Comments with #
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
419 @section Comments with #
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
420
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
421 The pound character, @samp{#}, may be used to start comments, in
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
422 addition to @samp{%}. See the previous example. The major advantage of
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
423 this is that as @samp{#} is also a comment character for unix script
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
424 files, any file that starts with a string like @samp{#! /usr/bin/octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
425 -q} will be 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
426
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
427 @node Strings delimited by double quotes "
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
428 @section Strings delimited by double quotes "
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
429 The double quote, @samp{"}, may be used to delimit strings, in addition
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
430 to the single quote @samp{'}. See the previous example. Also,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
431 double-quoted strings include backslash interpretation (like C++, C, and
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
432 Perl) while single quoted are uninterpreted (like @sc{Matlab} and Perl).
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
433
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
434 @node Line continuation by backslash
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
435 @section Line continuation by backslash
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
436
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
437 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
438 points @samp{@dots{}}. See the previous example.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
439
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
440 @node Informative block closing
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
441 @section Informative block closing
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
442
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
443 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
444 @dots{} blocks with @code{endfunction}, @code{endfor}, @code{endwhile},
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
445 @dots{} keywords in addition to using @code{end}. As with @sc{Matlab}, the
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
446 @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
447 function defined in a @file{.m} file is optional.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
448
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
449 @node Coherent syntax
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
450 @section Coherent syntax
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
451
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
452 Indexing other things than variables is possible, as in:
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
453 @example
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
454 @group
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
455 octave:1> [3 1 4 1 5 9](3)
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
456 ans = 4
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
457 octave:2> cos([0 pi pi/4 7])(3)
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
458 ans = 0.70711
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
459 @end group
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
460 @end example
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
461
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
462 @node Exclamation mark as not operator
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
463 @section Exclamation mark as not operator
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
464
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
465 The exclamation mark @samp{!} (aka ``Bang!'') is a negation operator, just
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
466 like the tilde @samp{~}:
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
467
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
468 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
469 @group
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
470 octave:1> if ! strcmp (program_name, "octave"),
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
471 > "It's an error"
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
472 > else
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
473 > "It works!"
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
474 > end
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
475 ans = It works!
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
476 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
477 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
478
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
479 @noindent
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
480 Note however that @sc{Matlab} uses the @samp{!} operator for shell
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
481 escapes, for which Octave requires using the @code{system} command.
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
482
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
483 @node Increment and decrement operators
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
484 @section Increment and decrement operators
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 @cindex Increment operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
487 @cindex Decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
488 @cindex Operators, increment
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
489 @cindex Operators, decrement
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
490
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
491 If you like the @samp{++}, @samp{+=} etc operators, rejoice!
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
492 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
493 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
494 @samp{+=}, @samp{-=}, @samp{*=}, @samp{/=}, @samp{^=}, @samp{.*=},
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
495 @samp{./=}, and @samp{.^=}.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
496
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
497 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
498 @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
499 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
500 same as the expression @code{@var{x} = @var{x} + 1}.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
501
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
502 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
503 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
504 @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
505 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
506 value of @var{x} is 3.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
507
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
508 For matrix and vector arguments, the increment and decrement operators
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
509 work on each element of the operand.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
510
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
511 @node Unwind-protect
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
512 @section Unwind-protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
513
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
514 @cindex Unwind-protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
515
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
516 Octave supports a limited form of exception handling modeled after the
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
517 unwind-protect form of Lisp. The general form of an
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
518 @code{unwind_protect} block looks like this:
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
519
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
520 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
521 @group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
522 unwind_protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
523 @var{body}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
524 unwind_protect_cleanup
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
525 @var{cleanup}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
526 end_unwind_protect
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
527 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
528 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
529
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
530 @noindent
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
531 Where @var{body} and @var{cleanup} are both optional and may contain any
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
532 Octave expressions or commands. The statements in @var{cleanup} are
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
533 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
534
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
535 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
536 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
537
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
538 @sc{Matlab} can be made to do something similar with their
12492
5b1654bc5012 Small FAQ fixes
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12490
diff changeset
539 @code{OnCleanUp} function that was introduced in 2008a. Octave also has
5b1654bc5012 Small FAQ fixes
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12490
diff changeset
540 @code{onCleanup} since version 3.4.0.
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
541
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
542 @node Built-in ODE and DAE solvers
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
543 @section Built-in ODE and DAE solvers
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
544
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
545 @cindex DASSL
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
546 @cindex LSODE
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
547
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
548 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
549 differential and differential-algebraic equations. These functions are
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
550 built in to the interpreter.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
551
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
552 @node Learning more about Octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
553 @chapter What documentation exists for Octave?
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
554
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
555 @menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
556 * Documentation::
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
557 * Getting additional help::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
558 * User community::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
559 * Bug reports::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
560 @end menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
561
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
562 @node Documentation
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
563 @section What documentation exists for Octave?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
564
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
565 @cindex Octave, documentation
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
566
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
567 The Octave distribution includes a 650+ page manual that is also
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
568 distributed under the terms of the GNU GPL.
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
569 It is available on the web at
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
570 @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
571 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
572
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
573 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
574 Info system via the GNU Emacs, info, or xinfo programs, or by using
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
575 the @samp{doc} command to start the GNU info browser directly from
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
576 the Octave prompt.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
577
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
578 If you have problems using this documentation, or find that some topic
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
579 is not adequately explained, indexed, or cross-referenced, please report
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
580 it on @url{http://bugs.octave.org}.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
581
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
582 @node Getting additional help
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
583 @section Getting additional help
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
584
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
585 @cindex Additional help
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
586 @cindex Mailing lists, help-octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
587
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
588 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
589 @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
590 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
591 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
592
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
593 @node User community
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
594 @section User community
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
595
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
596 To subscribe to the list, go to @url{http://www.octave.org/archive.html}
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
597 and 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
598
6653
673686daec87 [project @ 2007-05-22 15:36:09 by jwe]
jwe
parents: 6612
diff changeset
599 @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
600 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
601
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
602 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
603 on @url{http://www.octave.org/archive.html}.
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
604
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
605 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
606 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
607 Octave-Forge @url{http://octave.sourceforge.net}
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
608
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
609 @node Bug reports
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
610 @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
611
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
612 @cindex Bug in Octave, newly found
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
613
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
614 ``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
615 and who should I tell?''
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
616
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
617 @cindex Manual, for Octave
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
618
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
619 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
620 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
621 are using, the version of the operating system it is running, and the
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
622 version of Octave that you are using. Also provide enough code and
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
623 configuration details of your operating system so that the Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
624 maintainers can duplicate your bug.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
625
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
626 @node Getting Octave
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
627 @chapter Getting Octave
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
628
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
629 @menu
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
630 * Source code::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
631 * Pre-compiled binary packages::
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
632 * Octave for other platforms::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
633 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
634
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
635 @node Source code
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
636 @section Source code
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
637 @cindex Source code
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
638
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
639 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
640 sure to get the latest version.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
641
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
642 @itemize @bullet
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
643 @item @url{http://www.octave.org/download.html}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
644 @item @url{ftp://ftp.octave.org/pub/octave/}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
645 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
646
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
647 Since Octave is distributed under the terms of the GPL, you can get
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
648 Octave from a friend who has a copy, or from the Octave website.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
649
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
650 @node Pre-compiled binary packages
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
651 @section Pre-compiled binary packages
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
652 @cindex Pre-compiled binary packages
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
653 @cindex Binaries
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
654
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
655 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
656 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
657
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
658 @itemize @bullet
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
659 @item @url{http://www.octave.org/download.html}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
660 @item @url{http://wiki.octave.org/wiki.pl?CategoryInstall}
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
661 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
662
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
663 As of today, Octave binaries are available at least on Debian, Ubuntu,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
664 RedHat, Suse and Fedora GNU/Linuxen, Mac OS X, Windows' 98, 2000 and XP,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
665 Vista, and 7.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
666
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
667 @node Octave for other platforms
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
668 @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
669
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
670 @cindex VMS support
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
671 @cindex VAX
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
672 @cindex MS-DOS support
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
673 @cindex Windows support
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
674 @cindex DJGPP
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
675 @cindex EMX
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
676 @cindex OS/2 support
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
677
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
678 Octave currently runs on Unix-like systems, Mac OS X, and Windows.
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
679 It should be possible to make Octave work on other systems as well.
6879
28f3be713c1d [project @ 2007-09-07 21:35:44 by dbateman]
dbateman
parents: 6735
diff changeset
680 If you are interested in porting Octave to other systems, please contact
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
681 @email{maintainers@@octave.org}.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
682
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
683 @c @menu
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
684 @c * Octave for Unix::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
685 @c * Octave for other platforms::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
686 @c * latest versions::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
687 @c @end menu
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
688
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
689 @c @cindex Octave, ordering
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
690 @c @cindex Octave, getting a copy
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
691
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
692 @node Installation
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
693 @chapter Installation Issues and Problems
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
694
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
695 @cindex Octave, building
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
696
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
697 Octave 3.4 require approximately 1.3 GB of disk storage to unpack and
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
698 compile from source (considerably less if you don't compile with
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
699 debugging symbols). Once installed, Octave requires approximately 355 MB
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
700 of disk space (again, considerably less if you don't compile with
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
701 debugging symbols, approximately 50 MB).
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
702
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
703 @menu
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
704 * What else do I need?::
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
705 * Other C++ compilers?::
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
706 @end menu
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
707
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
708 @node What else do I need?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
709 @section What else do I need?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
710
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
711 @cindex GNU gcc
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
712 @cindex GNU g++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
713 @cindex libg++
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
714 @cindex GNU Make
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
715 @cindex Flex
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
716 @cindex GNU Bison
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
717
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
718 To compile Octave, you will need a recent version of GNU Make. You
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
719 will also need GCC 4.3 or later, although GCC 4.4 or later is
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
720 recommended.
3154
352a80c32765 [project @ 1998-02-14 19:17:59 by jwe]
jwe
parents: 3030
diff changeset
721
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
722 @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
723 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
724 GNU Make is very portable and easy to install.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
725
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
726 @node Other C++ compilers?
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
727 @section Can I compile Octave with another C++ compiler?
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
728
6584
cd06796e0ed6 [project @ 2007-04-26 15:41:29 by jwe]
jwe
parents: 6583
diff changeset
729 Yes, but development is done primarily with GCC, so you may hit some
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
730 incompatibilities. Octave is intended to be portable to any standard
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
731 conforming compiler. If you have difficulties that you think are bugs,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
732 please report them to the @url{http://bugs.octave.org} bug tracker, or
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
733 ask 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
734
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
735 @node Common problems
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
736 @chapter Common problems
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
737
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
738 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
739 questions (preferably with answers!)
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
740
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
741 @itemize @bullet
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
742 @item
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
743 Octave takes a long time to find symbols.
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
744
6606
2c19eaa2c6f7 [project @ 2007-05-07 17:09:38 by jwe]
jwe
parents: 6584
diff changeset
745 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
746 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
747 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
748 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
749
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
750 @item
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
751 When plotting Octave occasionally gives me errors like @samp{gnuplot> 9
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
752 0.735604 line 26317: invalid command}.
6735
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
753
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
754 There is a known bug in gnuplot 4.2 that can cause an off by one error
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
755 while piping data to gnuplot. It has been fixed in gnuplot 4.4.
6735
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
756
19e2d70e2a4c [project @ 2007-06-15 19:33:27 by dbateman]
dbateman
parents: 6653
diff changeset
757 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
758 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
759 included.
8215
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
760
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
761 @item
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
762 I cannot install a package. Octave complains about a missing
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
763 @code{mkoctfile}.
8215
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
764
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
765 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
766 @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
767 @itemize @minus
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
768 @item
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
769 Debian/Ubuntu
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
770
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
771 @c This will work once we upload the Octave packages without a version
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
772 @c in their name to Debian.
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
773 @code{aptitude install octave-headers}
8215
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
774
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
775 @item
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
776 Fedora
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
777
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
778 @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
779
518789a0539d FAQ entry about split development packages in distributions
Thomas Weber <thomas.weber.mail@gmail.com>
parents: 8130
diff changeset
780 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
781 @end itemize
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
782
12630
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
783 @node Using Octave
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
784 @chapter Using Octave
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
785
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
786 @menu
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
787 * How do I set the number of displayed decimals?::
12631
0c956011c35c OctaveFAQ.texi: Fix texinfo in FAQ I broke earlier
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12630
diff changeset
788 * How does Octave solve linear systems?::
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
789 @end menu
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
790
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
791 @cindex Tips and tricks
12630
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
792 @cindex Using Octave
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
793
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
794 @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
795 @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
796
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
797 @example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
798 @group
6583
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
799 octave:1> format long
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
800 octave:2> pi
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
801 pi = 3.14159265358979
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
802 octave:3> format short
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
803 octave:4> pi
e4ef75fe0bf2 [project @ 2007-04-26 04:01:08 by jwe]
jwe
parents: 6477
diff changeset
804 pi = 3.1416
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
805 @end group
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
806 @end example
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
807
12631
0c956011c35c OctaveFAQ.texi: Fix texinfo in FAQ I broke earlier
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12630
diff changeset
808 @node How does Octave solve linear systems?
0c956011c35c OctaveFAQ.texi: Fix texinfo in FAQ I broke earlier
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12630
diff changeset
809 @section How does Octave solve linear systems?
12630
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
810
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
811 @cindex backslash operator
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
812
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
813 In addition to consulting Octave's source for the precise details, the
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
814 Octave manual contains a complete high-level description of the
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
815 algorithm that Octave uses to decide how to solve a particular linear
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
816 system, e.g. how the backslash operator @code{A\x} will be interpreted.
12631
0c956011c35c OctaveFAQ.texi: Fix texinfo in FAQ I broke earlier
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12630
diff changeset
817 Sections ``Techniques Used for Linear Algebra'' and ``Linear Algebra on
12630
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
818 Sparse Matrices'' from the manual describe this procedure.
f154bef3cf61 OctaveFAQ.texi: Add a pointer to the manual concerning the backslash operator
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12492
diff changeset
819
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
820 @node @sc{Matlab} compatibility
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
821 @chapter Porting programs from @sc{Matlab} to Octave
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
822
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
823 @cindex @sc{Matlab} compatibility
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
824 @cindex Compatibility with @sc{Matlab}
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
825
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
826 People often ask
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
827
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
828 @quotation
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
829 I wrote some code for @sc{Matlab}, and I want to get it running under
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
830 Octave. Is there anything I should watch out for?
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
831 @end quotation
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
832
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
833 @noindent
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
834 or alternatively
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
835
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
836 @quotation
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
837 I wrote some code in Octave, and want to share it with @sc{Matlab}
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
838 users. Is there anything I should watch out for?
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
839 @end quotation
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
840
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
841 @noindent
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
842 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
843 differences between Octave and @sc{Matlab}, however in general
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
844 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
845 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
846 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
847 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
848 description of this difference (with code illustrating the difference,
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
849 if possible) to @url{http://bugs.octave.org}.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
850
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
851 Furthermore, Octave adds a few syntactical extensions to @sc{Matlab}
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
852 that might cause some issues when exchanging files between @sc{Matlab}
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
853 and Octave users. As both Octave and @sc{Matlab} are under constant
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
854 development the information in this section is subject to change at
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
855 anytime.
6612
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 You should also look at the page
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
858 @url{http://octave.sourceforge.net/packages.html} and
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
859 @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
860 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
861 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
862 compatibility.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
863
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
864 The major differences between Octave 3.4.N and @sc{Matlab} R2010b are:
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
865
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
866 @itemize @bullet
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
867 @item Nested Functions
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
868
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
869 Octave has limited support for nested functions. That is
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
870
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
871 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
872 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
873 function y = foo (x)
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
874 y = bar(x)
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
875 function y = bar (x)
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
876 y = @dots{};
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
877 end
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
878 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
879 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
880 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
881
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
882 is equivalent to
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
883
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
884 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
885 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
886 function y = foo (x)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
887 y = bar(x)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
888 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
889 function y = bar (x)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
890 y = @dots{};
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
891 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
892 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
893 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
894
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
895 The main difference with @sc{Matlab} is a matter of scope. While nested
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
896 functions have access to the parent function's scope in @sc{Matlab}, no
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
897 such thing is available in Octave, due to how Octave essentially
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
898 ``un-nests'' nested functions.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
899
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
900 The authors of Octave consider the nested function scoping rules of
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
901 @sc{Matlab} to be more problems than they are worth as they introduce
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
902 difficult to find bugs as inadvertently modifying a variable in a
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
903 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
904
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
905 @item Differences in core syntax
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
906 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
907 these being
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
908
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
909 @itemize @bullet
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
910 @item
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
911 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
912 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
913 function handles.
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
914
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
915 @item
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
916 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
917 though the most common types are accepted.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
918
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
919 @item
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
920 @sc{Matlab} classdef object oriented programming is not yet supported,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
921 though work is underway and when development more on to Octave 3.5 this
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
922 will be included in the development tree.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
923 @end itemize
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
924
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
925 @item Differences in core functions
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
926 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
927 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
928 commonly used ones. There are a few functions that aren't implemented,
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
929 usually to do with specific missing Octave functionality (GUI, DLL,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
930 Java, ActiveX, DDE, web, and serial functions). Some of the core
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
931 functions have limitations that aren't in the @sc{Matlab} version. For
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
932 example the @code{sprandn} function can not force a particular condition
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
933 number for the matrix like @sc{Matlab} can.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
934
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
935 @item Just-In-Time compiler
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
936 @sc{Matlab} includes a "Just-In-Time" compiler. This compiler allows the
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
937 acceleration of for-loops in @sc{Matlab} to almost native performance
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
938 with certain restrictions. The JIT must know the return type of all
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
939 functions called in the loops and so you can't include user functions in
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
940 the loop of JIT optimized loops. Octave doesn't have a JIT and so to
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
941 some might seem slower than @sc{Matlab}. For this reason you must
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
942 vectorize your code as much as possible. The MathWorks themselves have a
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
943 good document discussing vectorization at
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
944 @c It would be nice if we had our own guide for this instead of relying
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
945 @c on Matlab documentation.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
946 @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
947
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
948 @item Compiler
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
949 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
950 convert your Octave code into a binary for additional speed or
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
951 distribution. There have been several aborted attempts at creating an
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
952 Octave compiler. Should the JIT compiler above ever be implemented, an
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
953 Octave compiler should be more feasible.
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
954 @c Should we mention here any of the efforts to create a compiler? There
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
955 @c used to be a dead link here to http://www.stud.tu-ilmenau.de/~rueckn/
6612
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 Graphic Handles
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
958 Up to Octave 2.9.9 there was no support for graphic handles in Octave
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
959 itself. In the 3.2.N versions of Octave and beyond the support for
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
960 graphics handles is converging towards full compatibility. The
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
961 @code{patch} function is currently limited to 2-D patches, due to an
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
962 underlying limitation in gnuplot, but the experimental OpenGL backend is
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
963 starting to see an implementation of 3-D patches.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
964
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
965 @item GUI
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
966 There are no @sc{Matlab} compatible GUI functions. There are a number of
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
967 bindings from Octave to Tcl/Tk, VTK and Zenity included in the Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
968 @c Is it too early to mention here the nascent fltk UI buttons?
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
969 Forge project (@url{http://octave.sourceforge.net}) for example that can
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
970 be used for a GUI, but these are not @sc{Matlab} compatible. Work on a
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
971 @sc{Matlab} compatible GUI is in an alpha stage in the JHandles package
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
972 @c Is Jhandles still usable? I thought Michael Goffioul had more or less
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
973 @c already disowned it.
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
974 (@url{http://octave.sourceforge.net/jhandles/index.html}). This might be
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
975 an issue if you intend to exchange Octave code with @sc{Matlab} users.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
976
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
977 @item Simulink
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
978 Octave itself includes no Simulink support. Typically the simulink
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
979 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
980 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
981 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
982 simulink for the Octave and R projects available at
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
983 @c is this project in any state of usability?
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
984 @url{http://www.scicraft.org/}
6612
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 @item Mex-Files
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
987 Octave includes an API to the @sc{Matlab} MEX interface. However, as MEX
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
988 is an API to the internals of @sc{Matlab} and the internals of Octave
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
989 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
990 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
991 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
992 arrays as real and imaginary parts, whereas Octave respects the C99/C++
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
993 standards of co-locating the real/imag parts in memory. Also due to the
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
994 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
995 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
996 ones).
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
997
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
998 @item Block comments
8128
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
999 Block comments denoted by "%@{" and "%@}" markers are supported by
9e4a09b35cdb Update the FAQ
David Bateman <dbateman@free.fr>
parents: 7483
diff changeset
1000 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
1001 comments are not supported within [] or @{@}.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1002
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1003 @item Mat-File format
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1004 There are some differences in the mat v5 file format accepted by Octave.
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1005 @sc{Matlab} recently introduced the "-V7.3" save option which is an HDF5
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1006 format which is particularly useful for 64-bit platforms where the
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1007 standard @sc{Matlab} format can not correctly save variables. Octave
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1008 accepts HDF5 files, but is not yet compatible with the "-v7.3" versions
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1009 produced by @sc{Matlab}.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1010
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1011 Although Octave can load inline function handles saved by @sc{Matlab},
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1012 it can not yet save them.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1013
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1014 Finally, Some multi-byte Unicode characters aren't yet treated in
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1015 mat-files.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1016
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1017 @item Profiler
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1018 Octave doesn't have a profiler. Though there is a patch for a flat
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1019 profiler, that might become a real profiler sometime in the future. See
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1020 the thread
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1021
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1022 @c Did this idea go anywhere? Should it be mentioned?
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1023 @url{http://octave.1599824.n4.nabble.com/Octave-profiler-td1641945.html#a1641947}
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1024
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1025 for more details.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1026
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1027 @item Toolboxes
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1028 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
1029 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
1030 (@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
1031 functionality relative to the @sc{Matlab} toolboxes, and might not
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
1032 exactly duplicate the @sc{Matlab} functionality or interface.
6612
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 @item Short-circuit & and | operators
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1035 The @code{&} and @code{|} operators in @sc{Matlab} short-circuit when
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
1036 included in an if statement and not otherwise. In Octave only the
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1037 @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
1038
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1039 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1040 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1041 if (a | b)
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1042 @dots{}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1043 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1044 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1045 @end example
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 and
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1048
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1049 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1050 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1051 t = a | b;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1052 if t
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1053 @dots{}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1054 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1055 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1056 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1057
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1058 @noindent
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1059 are different in @sc{Matlab}. This is really a @sc{Matlab} bug, but
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1060 there is too much code out there that relies on this behaviour to change
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1061 it. Prefer the || and && operators in if statements if possible. If you
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1062 need to use code written for @sc{Matlab} that depends on this buggy
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1063 behaviour, you can enable it since Octave 3.4.0 with the following
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1064 command:
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1065
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1066 @example
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1067 @group
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1068 do_braindead_shortcircuit_evaluation(1)
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1069 @end group
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1070 @end example
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1071
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1072 Note that the difference with @sc{Matlab} is also significant when
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1073 either argument is a function with side effects or if the first argument
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1074 is a scalar and the second argument is an empty matrix. For example,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1075 note the difference between
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1076
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1077 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1078 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1079 t = 1 | []; ## results in [], so...
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1080 if (t) 1, end ## in if ([]), this is false.
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1081 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1082 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1083
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1084 and
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1085
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1086 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1087 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
1088 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1089
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1090 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
1091
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1092 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1093 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1094 t = [1, 1] | [1, 2, 3]; ## error
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1095 if ([1, 1] | [1, 2, 3]) 1, end ## OK
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1096 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1097 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1098
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1099 Also @sc{Matlab} requires the operands of && and || to be scalar values
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1100 but Octave does not (it just applies the rule that for an operand to be
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1101 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
1102 logically true).
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1103
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1104 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
1105 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
1106 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
1107
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1108 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1109 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1110 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
1111 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
1112 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1113 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1114
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1115 However,
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1116
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1117 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1118 if ([]) != if (all ([]))
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1119 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1120
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1121 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
1122 returning true if none of the elements of the matrix are zero, and since
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1123 there are no elements, well, none of them are zero. This is an example
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1124 of vacuous truth. But, somewhere along the line, someone decided that if
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1125 @code{([])} should be false. Mathworks probably thought it just looks
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1126 wrong to have @code{[]} be true in this context even if you can use
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1127 logical gymnastics to convince yourself that "all" the elements of a
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1128 matrix that doesn't actually have any elements are nonzero. Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1129 however duplicates this behavior for if statements containing empty
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1130 matrices.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1131
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1132 @item Solvers for singular, under- and over-determined matrices
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1133
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1134 @sc{Matlab}'s solvers as used by the operators mldivide (\) and mrdivide
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1135 (/), use a different approach than Octave's in the case of singular,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1136 under-, or over-determined matrices. In the case of a singular matrix,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1137 @sc{Matlab} returns the result given by the LU decomposition, even
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1138 though the underlying solver has flagged the result as erroneous. Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1139 has made the choice of falling back to a minimum norm solution of
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1140 matrices that have been flagged as singular which arguably is a better
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1141 result for these cases.
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1142
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1143 In the case of under- or over-determined matrices, Octave continues to
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1144 use a minimum norm solution, whereas @sc{Matlab} uses an approach that
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1145 is equivalent to
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1146
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1147 @example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1148 @group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1149 function x = mldivide (A, b)
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1150 [Q, R, E] = qr(A);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1151 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
1152 end
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1153 @end group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1154 @end example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1155
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1156 @noindent
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1157 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
1158 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
1159 other ways.
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1160
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1161 A numerical question arises: how big can the null space component
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1162 become, relative to the minimum-norm solution? Can it be nicely bounded,
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1163 or can it be arbitrarily big? Consider this example:
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1164
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1165 @example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1166 @group
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1167 m = 10;
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1168 n = 10000;
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1169 A = ones(m, n) + 1e-6 * randn(m,n);
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1170 b = ones(m, 1) + 1e-6 * randn(m,1);
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1171 norm(A \ b)
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1172 @end group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1173 @end example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1174
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1175 @noindent
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1176 while Octave's minimum-norm values are around 3e-2, @sc{Matlab}'s
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1177 results are 50-times larger. For another issue, try this code:
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1178
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1179 @example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1180 @group
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1181 m = 5;
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1182 n = 100;
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1183 j = floor(m * rand(1, n)) + 1;
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1184 b = ones(m, 1);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1185 A = zeros(m, n);
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1186 A(sub2ind(size(A),j,1:n)) = 1;
12479
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1187 x = A \ b;
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1188 [dummy,p] = sort(rand(1,n));
c741c1f2789e Minor proofreading in FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12478
diff changeset
1189 y = A(:,p)\b;
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1190 norm(x(p)-y)
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1191 @end group
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1192 @end example
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1193
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1194 @noindent
12478
b4138a75eecc Uniformise "Matlab" typesetting in FAQ.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 11576
diff changeset
1195 It shows that unlike in Octave, mldivide in @sc{Matlab} is not invariant
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1196 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
1197 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
1198 result than permuting the solution vector. This will surprise many
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1199 users.
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1200
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1201 Since the mldivide (\) and mrdivide (/) operators are often part of a
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1202 more complex expression, where there is no room to react to warnings or
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1203 flags, it should prefer intelligence (robustness) to speed, and so the
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1204 Octave developers are firmly of the opinion that Octave's approach for
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1205 singular, under- and over-determined matrices is a better choice that
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1206 @sc{Matlab}'s
8292
242756f065f0 Minor NEWS/FAQ update
David Bateman <dbateman@free.fr>
parents: 8215
diff changeset
1207
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1208 @item Octave extensions
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1209 The extensions in Octave over @sc{Matlab} syntax are
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1210 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
1211 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
1212 with @sc{Matlab} are
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1213
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1214 @itemize @bullet
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1215 @item
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1216 Comments in octave can be marked with @samp{#}. This allows POSIX
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1217 systems to have the first line as @samp{#! octave -q} and mark the
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1218 script itself executable. @sc{Matlab} doesn't have this feature due to
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1219 the absence of comments starting with @samp{#}".
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1220
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1221 @item
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1222 Code blocks like @code{if}, @code{for}, @code{while}, etc can be
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1223 terminated with block specific terminations like @code{endif}.
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1224 @sc{Matlab} doesn't have this and all blocks must be terminated with
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1225 @code{end}.
6612
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 @item
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1228 Octave has a lisp like @code{unwind_protect} block that allows blocks of
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1229 code that terminate in an error to ensure that the variables that are
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1230 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
1231 @code{try}/@code{catch} combined with @samp{rethrow (lasterror ())} in
12490
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1232 @sc{Matlab}, however rethrow and lasterror are only available in Octave
30f2a3b1d236 Major update to FAQ
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12479
diff changeset
1233 2.9.10 and later. @sc{Matlab} 2008a also introduced @code{OnCleanUp}
12492
5b1654bc5012 Small FAQ fixes
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12490
diff changeset
1234 that is similar to @code{unwind_protect}, except that the object created
5b1654bc5012 Small FAQ fixes
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12490
diff changeset
1235 by this function has to be explicitly cleared in order for the cleanup
5b1654bc5012 Small FAQ fixes
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12490
diff changeset
1236 code to run.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1237
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1238 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
1239 (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
1240 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
1241 example
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1242
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1243 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1244 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1245 global a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1246 a = 1;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1247 try
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1248 _a = a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1249 a = 2
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1250 while true
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1251 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1252 catch
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1253 fprintf ('caught interrupt\n');
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1254 a = _a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1255 rethrow (lasterror());
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1256 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1257 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1258 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1259
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1260 @noindent
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1261 compared to
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1262
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1263 @example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1264 @group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1265 global a
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1266 a = 1;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1267 unwind_protect
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1268 _a = a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1269 a = 2
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1270 while true
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1271 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1272 unwind_protect_cleanup
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1273 fprintf ('caught interrupt\n');
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1274 a = _a;
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1275 end
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1276 @end group
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1277 @end example
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1278
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1279 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
1280 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
1281 second case the variable "a" is reset correctly. Therefore @sc{Matlab}
12492
5b1654bc5012 Small FAQ fixes
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12490
diff changeset
1282 gives no safe way of temporarily changing global variables.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1283
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1284 @item
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1285 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
1286 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
1287 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
1288 @code{y = sin(x); y = y([1:10]);}
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1289
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1290 @item
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1291 Octave has the operators "++", "--", "-=", "+=", "*=", etc. As
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1292 @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
1293
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1294 @item
6900
e2d560e5a58d [project @ 2007-09-14 17:00:15 by jwe]
jwe
parents: 6879
diff changeset
1295 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
1296 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
1297 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
1298 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
1299 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
1300 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
1301 paths. @sc{Matlab} doesn't have double quoted strings and so they should
12702
013cd94d8d7f doc: Spelling fixes for various documentation files
John Bradshaw <john@johnbradshaw.org>
parents: 12492
diff changeset
1302 be avoided if the code will be transferred to a @sc{Matlab} user.
6612
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1303 @end itemize
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1304
89f3a84a0da1 [project @ 2007-05-09 21:17:45 by jwe]
jwe
parents: 6606
diff changeset
1305 @end itemize
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1306
4830
a3dd9369a1d4 [project @ 2004-03-10 06:10:19 by jwe]
jwe
parents: 4476
diff changeset
1307 @node Index
2866
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1308 @appendix Concept Index
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1309
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1310 @printindex cp
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1311
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1312 @page
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1313 @contents
ef2e333f469c [project @ 1997-04-18 07:39:43 by jwe]
jwe
parents:
diff changeset
1314 @bye