2866
|
1 \input texinfo.tex @c -*-texinfo-*- |
|
2 |
3030
|
3 @setfilename Octave-FAQ.info |
2866
|
4 @settitle Frequently asked questions about Octave (with answers) |
|
5 |
|
6 @setchapternewpage off |
5099
|
7 @direntry |
6584
|
8 * Octave-FAQ: (Octave-FAQ). Frequently asked questions about Octave |
5099
|
9 @end direntry |
2866
|
10 @titlepage |
|
11 @title Octave FAQ |
|
12 @subtitle Frequently asked questions about Octave |
6583
|
13 @subtitle April, 2007 |
2866
|
14 @sp 1 |
|
15 @author John W. Eaton |
|
16 @page |
|
17 @end titlepage |
|
18 |
5423
|
19 @ifnottex |
4830
|
20 @node Top |
2866
|
21 @top |
|
22 @unnumbered Preface |
|
23 @cindex FAQ for Octave, latest version |
5423
|
24 @end ifnottex |
2866
|
25 |
|
26 This is a list of frequently asked questions (FAQ) for Octave users. |
|
27 |
6584
|
28 We are always looking for new questions (@emph{with} answers), better |
|
29 answers, or both. Please send suggestions to @email{bug@@octave.org}. |
|
30 If you have general questions about Octave, or need help for something |
|
31 that is not covered by the Octave manual or the FAQ, please use the |
|
32 @email{help@@octave.org} mailing list. |
2866
|
33 |
|
34 This FAQ is intended to supplement, not replace, the Octave manual. |
6584
|
35 Before posting a question to the @email{help@@octave.org} mailing list, |
|
36 you should first check to see if the topic is covered in the manual. |
2866
|
37 |
|
38 @menu |
6583
|
39 * What is Octave?:: |
|
40 * How can I cite Octave?:: |
|
41 * Series 2.9.N:: |
|
42 * Octave Features:: |
|
43 * Learning more about Octave:: |
|
44 * Getting Octave:: |
|
45 * Installation:: |
2866
|
46 * Common problems:: |
6584
|
47 * How do I ...?:: |
6583
|
48 * MATLAB compatibility:: |
2866
|
49 * Index:: |
|
50 @end menu |
|
51 |
4830
|
52 @node What is Octave? |
2866
|
53 @chapter What is Octave? |
|
54 |
|
55 Octave is a high-level interactive language, primarily intended for |
|
56 numerical computations that is mostly compatible with |
|
57 @sc{Matlab}.@footnote{@sc{Matlab} is a registered trademark of The MathWorks, |
6583
|
58 Inc.} |
2866
|
59 |
6583
|
60 Octave can do arithmetic for real, complex or integer-valued scalars |
|
61 and matrices, solve sets of nonlinear algebraic equations, integrate |
|
62 functions over finite and infinite intervals, and integrate systems of |
|
63 ordinary differential and differential-algebraic equations. |
2866
|
64 |
|
65 Octave uses the GNU readline library to handle reading and editing |
|
66 input. By default, the line editing commands are similar to the |
|
67 cursor movement commands used by GNU Emacs, and a vi-style line |
|
68 editing interface is also available. At the end of each session, the |
|
69 command history is saved, so that commands entered during previous |
|
70 sessions are not lost. |
|
71 |
6583
|
72 The Octave distribution includes a 500+ page Texinfo manual. Access |
2866
|
73 to the complete text of the manual is available via the help command |
6583
|
74 @c really, the *complete* text? |
2866
|
75 at the Octave prompt. |
|
76 |
6583
|
77 @menu |
|
78 * Who develops Octave?:: |
6584
|
79 * Why GNU Octave?:: |
6583
|
80 * What version should I use?:: |
|
81 * On what platforms does Octave run?:: |
|
82 @end menu |
|
83 |
|
84 @node Who develops Octave? |
|
85 @section Who develops Octave? |
|
86 |
6584
|
87 Discussions about writing the software that would eventually become |
|
88 Octave started in about 1988 with James B. Rawlings and John W. Eaton at |
|
89 the University of Texas. John W. Eaton was the original author of |
|
90 Octave, starting full-time development in February 1992. He is still |
|
91 the primary maintainer. The community |
|
92 of users/developers has in addition contributed some code and fuels the |
|
93 discussion on the mailing lists @email{help@@octave.org} (user forum), |
|
94 @email{bug@@octave.org} (bug reports), @email{maintainers@@octave.org} |
|
95 (development issues), and @email{octave-dev@@lists.sourceforge.net} (all |
|
96 things related to the Octave Forge repository of user-contributed |
|
97 functions). |
6583
|
98 |
6584
|
99 @node Why GNU Octave? |
|
100 @section Why GNU Octave? |
6583
|
101 |
6584
|
102 The GNU Project was launched in 1984 to develop a complete Unix-like |
|
103 operating system which is free software: the GNU system. |
|
104 |
|
105 GNU is a recursive acronym for ``GNU's Not Unix''; it is pronounced |
|
106 guh-noo, approximately like canoe. |
6583
|
107 |
6584
|
108 The Free Software Foundation (FSF) is the principal organizational |
|
109 sponsor of the GNU Project. |
|
110 |
|
111 Octave became GNU Octave in 1997 (beginning with version 2.0.6). This |
|
112 meant agreeing to consider Octave a part of the GNU Project and support |
|
113 the efforts of the FSF. However, Octave is not and has never been |
|
114 developed by the FSF. |
|
115 |
|
116 For more information about the GNU project, see @url{www.gnu.org}. |
6583
|
117 |
|
118 @cindex FSF [Free Software Foundation] |
|
119 @cindex GNU [GNU's not unix] |
|
120 |
|
121 @node What version should I use? |
|
122 @section What version should I use? |
|
123 |
|
124 In general, you will find the latest version on |
6584
|
125 @url{http://www.octave.org/download.html}. It is |
6583
|
126 recommended to use the ``testing'' version of octave for general use, |
|
127 and the ``development'' version if you want the latest features. |
|
128 |
|
129 A list of user-visible changes since the last release is available in |
|
130 the file @file{NEWS}. The file @file{ChangeLog} in the source |
|
131 distribution contains a more detailed record of changes made since the |
|
132 last release. |
|
133 |
|
134 @node On what platforms does Octave run? |
|
135 @section On what platforms does Octave run? |
|
136 |
6584
|
137 Octave runs on various Unices---at least Linux and Solaris, Mac OS X, |
|
138 Windows and anything you can compile it on. Binary distributions exist |
6583
|
139 at least for Debian, Suse, Fedora and RedHat Linuxes (Intel and AMD |
|
140 CPUs, at least), for Mac Os X and Windows' 98, 2000 and XP. |
|
141 |
2866
|
142 Two and three dimensional plotting is fully supported using gnuplot. |
|
143 |
|
144 The underlying numerical solvers are currently standard Fortran ones |
|
145 like Lapack, Linpack, Odepack, the Blas, etc., packaged in a library |
|
146 of C++ classes. If possible, the Fortran subroutines are compiled |
|
147 with the system's Fortran compiler, and called directly from the C++ |
|
148 functions. If that's not possible, you can still compile Octave if |
|
149 you have the free Fortran to C translator f2c. |
|
150 |
|
151 Octave is also free software; you can redistribute it and/or modify it |
|
152 under the terms of the GNU General Public License as published by the |
|
153 Free Software Foundation. |
|
154 |
4830
|
155 @node How can I cite Octave? |
|
156 @chapter How can I cite Octave? |
4831
|
157 |
|
158 Pointing to @url{http://www.octave.org} is good, because that gives |
|
159 people a direct way to find out more. If citation of a URL is not |
|
160 allowed by a publisher, or if you also want to point to a traditional |
|
161 reference, then you can cite the Octave manual: |
4830
|
162 |
|
163 @example |
|
164 @group |
6584
|
165 @@BOOK@{eaton:2002, |
|
166 author = "John W. Eaton", |
|
167 title = "GNU Octave Manual", |
|
168 publisher = "Network Theory Limited", |
|
169 year = "2002", |
|
170 isbn = "0-9541617-2-6" |
|
171 @} |
4830
|
172 @end group |
|
173 @end example |
|
174 |
6583
|
175 @node Series 2.9.N |
|
176 @chapter What's new in version series 2.9.N of Octave |
|
177 |
6584
|
178 The 2.9.N series, started in March 2005, has enough new features to |
|
179 justify a major version number change. Version 2.9.10 is nearly as |
6583
|
180 stable as the latest 2.1.N releases and stability should increase as |
|
181 one gets near version 3.0. |
|
182 |
|
183 Series 2.9.N brings |
|
184 |
|
185 @itemize @bullet |
|
186 |
|
187 @item integer types |
|
188 |
|
189 @item fixed point arithmetic |
|
190 |
|
191 @item sparse matrices |
|
192 |
|
193 @item Linear programming code based on GLPK |
|
194 |
|
195 @item 64-bit compilation support |
|
196 |
|
197 @item gzipped files and stream and consequently support of matlab v7 files |
2866
|
198 |
6583
|
199 @item better support for both msvc and mingw |
|
200 |
|
201 @item many many other minor features and compatibility changes |
|
202 |
|
203 @item a fully compatiable MEX interface |
|
204 |
|
205 @end itemize |
|
206 |
|
207 Here are some features that have been around since 2.1.NN |
|
208 |
|
209 @itemize @bullet |
2866
|
210 |
6583
|
211 @item NDarrays |
|
212 |
|
213 @item cells |
|
214 |
|
215 @end itemize |
|
216 |
4830
|
217 @node Octave Features |
2866
|
218 @chapter What features are unique to Octave? |
|
219 |
|
220 @menu |
6583
|
221 * Functions defined on the command-line:: |
|
222 * Comments with #:: |
|
223 * Strings delimitted by double quotes ":: |
|
224 * Line continuation by backslash:: |
|
225 * Informative block closing:: |
|
226 * Coherent syntax:: |
|
227 * Exclamation mark as not operator:: |
|
228 @c * Short-circuit boolean operators:: |
2866
|
229 * Increment and decrement operators:: |
|
230 * Unwind-protect:: |
6583
|
231 * Built-in ODE and DAE solvers:: |
2866
|
232 @end menu |
|
233 |
6583
|
234 This section refers to Matlab 6,5.0 R 13 and Octave 2.9.10. |
2866
|
235 |
6583
|
236 @node Functions defined on the command-line |
|
237 @section Functions defined on the command-line |
2866
|
238 |
6583
|
239 Functions can be defined by entering code on the command line, a |
6584
|
240 feature not supported by the other leading brand. For example, you may |
6583
|
241 type: |
2866
|
242 |
|
243 @example |
|
244 @group |
6583
|
245 octave:1> function s = hello_string (to_who) |
|
246 > ## Say hello |
|
247 > if nargin<1, to_who = "World"; end |
|
248 > s = ["Hello ",\ |
|
249 > to_who]; |
|
250 > endfunction |
|
251 octave:2> hello_string ("Moon") |
|
252 ans = Hello Moon |
2866
|
253 @end group |
|
254 @end example |
|
255 |
6583
|
256 @node Comments with # |
|
257 @section Comments with # |
|
258 |
6584
|
259 The pound character, @samp{#}, may be used to start comments, in addition |
|
260 to @samp{%}. See the previous example. The major advantage of this is |
|
261 that as @samp{#} is also a comment character for unix script files, any |
|
262 file that starts with a string like @samp{#! /usr/bin/octave -q} will be |
|
263 treated as an octave script and be executed by octave. |
2866
|
264 |
6583
|
265 @node Strings delimitted by double quotes " |
|
266 @section Strings delimitted by double quotes " |
6584
|
267 The double quote, @samp{"}, may be used to delimit strings, in addition to |
|
268 the single quote @samp{'}. See the previous example. Also, double-quoted |
|
269 strings include backslash interpretation (like C++, C, and Perl) while |
|
270 single quoted are uninterpreted (like Matlab and Perl). |
6583
|
271 |
|
272 @node Line continuation by backslash |
|
273 @section Line continuation by backslash |
|
274 |
6584
|
275 Lines can be continued with a backslash, @samp{\}, in addition to three |
|
276 points @samp{@dots{}}. See the previous example. |
6583
|
277 |
|
278 @node Informative block closing |
|
279 @section Informative block closing |
|
280 |
6584
|
281 You may close @code{function}, @code{for}, @code{while}, @code{if}, |
|
282 @dots{} blocks with @code{endfunction}, @code{endfor}, @code{endwhile}, |
|
283 @dots{} keywords in addition to using @code{end}. As with Matlab, the |
|
284 @code{end} (or @code{endfunction}) keyword that marks the end of a |
|
285 function defined in a @file{.m} file is optional. |
2866
|
286 |
6583
|
287 @node Coherent syntax |
|
288 @section Coherent syntax |
|
289 |
|
290 Indexing other things than variables is possible, as in: |
|
291 @example |
|
292 @group |
|
293 octave:1> [3 1 4 1 5 9](3) |
|
294 ans = 4 |
|
295 octave:2> cos([0 pi pi/4 7])(3) |
|
296 ans = 0.70711 |
|
297 @end group |
|
298 @end example |
|
299 |
|
300 @node Exclamation mark as not operator |
|
301 @section Exclamation mark as not operator |
|
302 |
|
303 The exclamation mark '!' (aka ``Bang!'') is a negation operator, just |
|
304 like the tilde '~': |
2866
|
305 |
|
306 @example |
|
307 @group |
6583
|
308 octave:1> if ! strcmp (program_name, "octave"), |
|
309 > "It's an error" |
|
310 > else |
|
311 > "It works!" |
|
312 > end |
|
313 ans = It works! |
2866
|
314 @end group |
|
315 @end example |
|
316 |
4830
|
317 @node Increment and decrement operators |
2866
|
318 @section Increment and decrement operators |
|
319 |
|
320 @cindex Increment operators |
|
321 @cindex Decrement operators |
|
322 @cindex Operators, increment |
|
323 @cindex Operators, decrement |
|
324 |
6584
|
325 If you like the @samp{++}, @samp{+=} etc operators, rejoice! |
2866
|
326 Octave includes the C-like increment and decrement operators @samp{++} |
6583
|
327 and @samp{--} in both their prefix and postfix forms, in addition to |
|
328 @samp{+=}, @samp{-=}, @samp{*=}, @samp{/=}, @samp{^=}, @samp{.*=}, |
|
329 @samp{./=}, and @samp{.^=}. |
2866
|
330 |
|
331 For example, to pre-increment the variable @var{x}, you would write |
|
332 @code{++@var{x}}. This would add one to @var{x} and then return the new |
|
333 value of @var{x} as the result of the expression. It is exactly the |
|
334 same as the expression @code{@var{x} = @var{x} + 1}. |
|
335 |
6584
|
336 To post-increment a variable @var{x}, you would write @code{x++}. |
2866
|
337 This adds one to the variable @var{x}, but returns the value that |
|
338 @var{x} had prior to incrementing it. For example, if @var{x} is equal |
6584
|
339 to 2, the result of the expression @code{x++} is 2, and the new |
2866
|
340 value of @var{x} is 3. |
|
341 |
|
342 For matrix and vector arguments, the increment and decrement operators |
|
343 work on each element of the operand. |
|
344 |
|
345 |
4830
|
346 @node Unwind-protect |
2866
|
347 @section Unwind-protect |
|
348 |
|
349 @cindex Unwind-protect |
|
350 |
|
351 Octave supports a limited form of exception handling modelled after the |
|
352 unwind-protect form of Lisp. The general form of an |
|
353 @code{unwind_protect} block looks like this: |
|
354 |
|
355 @example |
|
356 @group |
|
357 unwind_protect |
|
358 @var{body} |
|
359 unwind_protect_cleanup |
|
360 @var{cleanup} |
|
361 end_unwind_protect |
|
362 @end group |
|
363 @end example |
|
364 |
|
365 @noindent |
|
366 Where @var{body} and @var{cleanup} are both optional and may contain any |
|
367 Octave expressions or commands. The statements in @var{cleanup} are |
|
368 guaranteed to be executed regardless of how control exits @var{body}. |
|
369 |
|
370 The @code{unwind_protect} statement is often used to reliably restore |
|
371 the values of global variables that need to be temporarily changed. |
|
372 |
4830
|
373 @node Built-in ODE and DAE solvers |
2866
|
374 @section Built-in ODE and DAE solvers |
|
375 |
|
376 @cindex DASSL |
|
377 @cindex LSODE |
|
378 |
|
379 Octave includes LSODE and DASSL for solving systems of stiff ordinary |
|
380 differential and differential-algebraic equations. These functions are |
|
381 built in to the interpreter. |
|
382 |
6583
|
383 @node Learning more about Octave |
|
384 @chapter What documentation exists for Octave? |
|
385 |
|
386 @menu |
|
387 * Documentation:: |
|
388 * Getting additional help:: |
|
389 * User community:: |
|
390 * Bug reports:: |
|
391 @end menu |
|
392 |
|
393 |
4830
|
394 @node Documentation |
6583
|
395 @section What documentation exists for Octave? |
2866
|
396 |
|
397 @cindex Octave, documentation |
|
398 |
6584
|
399 The Octave distribution includes a 550+ page manual that is also |
2866
|
400 distributed under the terms of the GNU GPL. |
6583
|
401 It is available on the web at |
|
402 @url{http://www.octave.org/docs.html} and you will also |
|
403 find there instructions on how to order a paper version. |
|
404 |
|
405 The complete text of the Octave manual is also available using the GNU |
|
406 Info system via the GNU Emacs, info, or xinfo programs, or by using |
|
407 the @samp{help -i} command to start the GNU info browser directly from |
|
408 the Octave prompt. |
|
409 |
|
410 If you have problems using this documentation, or find that some topic |
|
411 is not adequately explained, indexed, or cross-referenced, please send |
6584
|
412 a bug report to @email{bug@@octave.org}. |
6583
|
413 |
2866
|
414 |
6583
|
415 @node Getting additional help |
|
416 @section Getting additional help |
|
417 |
|
418 @cindex Additional help |
|
419 @cindex Mailing lists, help-octave |
|
420 |
6584
|
421 If you can't find an answer to your question, the |
|
422 @email{help@@octave.org} mailing list is available for questions related |
|
423 to using, installing, and porting Octave that are not adequately |
|
424 answered by the Octave manual or by this document. |
6583
|
425 |
|
426 @node User community |
|
427 @section User community |
|
428 |
6584
|
429 To subscribe to the list, go to @url{www.octave.org/archive.html} and |
|
430 follow the link to the subscription page for the list. |
2866
|
431 |
6583
|
432 @strong{Please do not} send requests to be added or removed from the the |
|
433 mailing list, or other administrative trivia to the list itself. |
|
434 |
|
435 An archive of old postings to the help-octave mailing list is maintained |
|
436 on @url{http://www.octave.org/archive.html}. |
|
437 |
6584
|
438 You will also find some user advice and code spread over the web. Good |
6583
|
439 starting points are the Octave Wiki @url{http://wiki.octave.org} and |
|
440 Octave-Forge @url{htt://octave.sourceforge.net} |
|
441 |
|
442 @node Bug reports |
|
443 @section I think I have found a bug in Octave. |
|
444 |
|
445 @cindex Bug in Octave, newly found |
|
446 |
|
447 ``I think I have found a bug in Octave, but I'm not sure. How do I know, |
|
448 and who should I tell?'' |
2866
|
449 |
6583
|
450 @cindex Manual, for Octave |
|
451 |
|
452 First, see the section on bugs and bug reports in the Octave manual. |
|
453 When you report a bug, make sure to describe the type of computer you |
|
454 are using, the version of the operating system it is running, and the |
|
455 version of Octave that you are using. Also provide enough code so that |
|
456 the Octave maintainers can duplicate your bug. |
|
457 |
|
458 If you have Octave working at all, the easiest way to do this is to use |
|
459 the Octave function @code{bug_report}. When you execute this function, |
|
460 Octave will prompt you for a subject and then invoke the editor on a |
|
461 file that already contains all the configuration information. When you |
|
462 exit the editor, Octave will mail the bug report for you (in a unix-like |
|
463 operating system). |
|
464 |
|
465 @cindex Octave bug report |
|
466 @cindex Mailing lists, bug-octave |
|
467 |
|
468 If for some reason you cannot use Octave's @code{bug_report} function, |
6584
|
469 mail your bug report to @email{bug@@octave.org}. Your message needs to |
6583
|
470 include enough information to allow the maintainers of Octave to fix the |
|
471 bug. Please read the section on bugs and bug reports in the Octave |
|
472 manual for a list of things that should be included in every bug report. |
|
473 |
2866
|
474 |
4830
|
475 @node Getting Octave |
6583
|
476 @chapter Getting Octave |
2866
|
477 |
|
478 @menu |
6583
|
479 * Source code:: |
|
480 * Pre-compiled binary packages:: |
|
481 * Octave for other platforms:: |
2866
|
482 @end menu |
|
483 |
6583
|
484 @node Source code |
|
485 @section Source code |
|
486 @cindex Source code |
2866
|
487 |
6583
|
488 Source code is available on the Octave development site, where you are |
|
489 sure to get the latest version. |
2866
|
490 |
6583
|
491 @itemize @bullet |
|
492 @item @url{http://www.octave.org/download.html} |
|
493 @item @url{ftp://ftp.octave.org/pub/octave/} |
|
494 @end itemize |
2866
|
495 |
6583
|
496 Since Octave is distrubted under the terms of the GPL, you can get |
|
497 Octave from a friend who has a copy, by anonymous FTP, or by ordering |
|
498 a tape or CD-ROM from the Free Software Foundation (FSF). |
2866
|
499 |
6583
|
500 @node Pre-compiled binary packages |
|
501 @section Pre-compiled binary packages |
|
502 @cindex Pre-compiled binary packages |
|
503 @cindex Binaries |
2866
|
504 |
6584
|
505 The Octave project does not distribute binary packages, but other |
|
506 projects do. For an up-to-date listing of packagers, see: |
2866
|
507 |
6583
|
508 @itemize @bullet |
|
509 @item @url{http://www.octave.org/download.html} |
|
510 @item @url{http://wiki.octave.org/wiki.pl?CategoryInstall} |
|
511 @end itemize |
2866
|
512 |
6583
|
513 As of today, Octave binaries are available at least on Debian, RedHat, |
|
514 Suse and Fedora Linuxes, Mac OS X, Windows' 98, 2000 and XP. |
2866
|
515 |
4830
|
516 @node Octave for other platforms |
2866
|
517 @section How do I get a copy of Octave for (some other platform)? |
|
518 |
|
519 @cindex VMS support |
|
520 @cindex VAX |
|
521 @cindex MS-DOS support |
3154
|
522 @cindex Windows support |
2866
|
523 @cindex DJGPP |
|
524 @cindex EMX |
|
525 @cindex OS/2 support |
|
526 |
6584
|
527 Octave currently runs on Unix-like systems, Mac OS X, and Windows |
3840
|
528 (using the Cygwin tools from Red Hat). It should be possible |
3154
|
529 to make Octave work on other systems as well. If you are interested in |
|
530 porting Octave to other systems, please contact |
6584
|
531 @email{bug@@octave.org}. |
2866
|
532 |
6583
|
533 @c @menu |
|
534 @c * Octave for Unix:: |
|
535 @c * Octave for other platforms:: |
|
536 @c * latest versions:: |
|
537 @c @end menu |
2866
|
538 |
6583
|
539 @c @cindex Octave, ordering |
|
540 @c @cindex Octave, getting a copy |
2866
|
541 |
4830
|
542 @node Installation |
2866
|
543 @chapter Installation Issues and Problems |
|
544 |
|
545 @cindex Octave, building |
|
546 |
6584
|
547 Octave 2.9.10 requires approximately 800MB of disk storage to unpack |
|
548 and compile from source (considerably less if you don't compile with |
|
549 debugging symbols). Once installed, Octave requires approximately 200MB |
|
550 of disk space (again, considerably less if you don't compile with |
|
551 debugging symbols). |
2866
|
552 |
|
553 @menu |
|
554 * What else do I need?:: |
|
555 * Other C++ compilers?:: |
|
556 @end menu |
|
557 |
4830
|
558 @node What else do I need? |
2866
|
559 @section What else do I need? |
|
560 |
|
561 @cindex GNU gcc |
|
562 @cindex GNU g++ |
|
563 @cindex libg++ |
|
564 @cindex GNU Make |
|
565 @cindex Flex |
|
566 @cindex GNU Bison |
|
567 |
3154
|
568 To compile Octave, you will need a recent version of GNU Make. You |
6584
|
569 will also need GCC 3.3 or later, although GCC 4.1 or later is |
|
570 recommended. |
3154
|
571 |
6584
|
572 @strong{You must have GNU Make to compile octave}. Octave's Makefiles |
3154
|
573 use features of GNU Make that are not present in other versions of make. |
|
574 GNU Make is very portable and easy to install. |
2866
|
575 |
4830
|
576 @node Other C++ compilers? |
2866
|
577 @section Can I compile Octave with another C++ compiler? |
|
578 |
6584
|
579 Yes, but development is done primarily with GCC, so you may hit some |
|
580 incompatibilities. Octave is intended to be portable to any standard |
|
581 conforming compiler. If you have difficulties that you think are bugs, |
|
582 please report them to the @email{bug@@octave.org} mailing list, or ask |
|
583 for help on the @email{help@@octave.org} mailing list. |
2866
|
584 |
4830
|
585 @node Common problems |
2866
|
586 @chapter Common problems |
|
587 |
|
588 This list is probably far too short. Feel free to suggest additional |
|
589 questions (preferably with answers!) |
|
590 |
|
591 @itemize @bullet |
|
592 @item |
|
593 Octave takes a long time to find symbols. |
|
594 |
6477
|
595 Octave is probably spending this time recursively searching directories for |
|
596 function files. Check the value of the internal variable LOADPATH, |
|
597 accessible through the Octave fucntion @code{path}. For those |
2866
|
598 elements that end in @samp{//}, do any name a very large directory tree? |
6477
|
599 Does it contain directories that have a mixture of files and |
|
600 directories? In order for the recursive directory searching code to |
2866
|
601 work efficiently, directories that are to be searched recursively should |
|
602 have either function files only, or subdirectories only, but not a |
|
603 mixture of both. Check to make sure that Octave's standard set of |
|
604 function files is installed this way. |
|
605 @end itemize |
|
606 |
6584
|
607 @node How do I ...? |
|
608 @chapter How do I ...? |
2866
|
609 |
6583
|
610 @menu |
|
611 * How do I set the number of displayed decimals?:: |
|
612 @end menu |
2866
|
613 |
6583
|
614 @cindex Tips and tricks |
6584
|
615 @cindex How do I @dots{} ? |
2866
|
616 |
6583
|
617 @node How do I set the number of displayed decimals? |
|
618 @section How do I set the number of displayed decimals? |
2866
|
619 |
|
620 |
|
621 @example |
|
622 @group |
6583
|
623 octave:1> format long |
|
624 octave:2> pi |
|
625 pi = 3.14159265358979 |
|
626 octave:3> format short |
|
627 octave:4> pi |
|
628 pi = 3.1416 |
2866
|
629 @end group |
|
630 @end example |
|
631 |
4830
|
632 @node MATLAB compatibility |
2866
|
633 @chapter Porting programs from @sc{Matlab} to Octave |
|
634 |
|
635 @cindex @sc{Matlab} compatibility |
|
636 @cindex Compatibility with @sc{Matlab} |
|
637 |
|
638 ``I wrote some code for @sc{Matlab}, and I want to get it running under |
|
639 Octave. Is there anything I should watch out for?'' |
|
640 |
|
641 The differences between Octave and @sc{Matlab} typically fall into one of |
|
642 three categories: |
|
643 |
|
644 @enumerate |
|
645 @item |
|
646 Irrelevant. |
|
647 |
|
648 @item |
|
649 Known differences, perhaps configurable with a user preference variable. |
|
650 |
|
651 @item |
|
652 Unknown differences. |
|
653 @end enumerate |
|
654 |
|
655 The first category, irrelevant differences, do not affect computations |
|
656 and most likely do not affect the execution of function files. |
|
657 |
|
658 The differences of the second category are usually because the authors |
6584
|
659 of Octave decided on a better (subjective) implementation than the way |
|
660 @sc{Matlab} works. To make Octave more @sc{Matlab}-compatible, use the |
|
661 command line option @samp{--traditional} (though really, with the latest |
|
662 2.9.N version, most of the things that the @samp{--traditional} option |
|
663 does are just cosmetic. |
2866
|
664 |
|
665 The third category of differences is (hopefully) shrinking. If you find |
|
666 a difference between Octave behavior and @sc{Matlab}, then you should send a |
|
667 description of this difference (with code illustrating the difference, |
6584
|
668 if possible) to @email{bug@@octave.org}. |
2866
|
669 |
4830
|
670 @node Index |
2866
|
671 @appendix Concept Index |
|
672 |
|
673 @printindex cp |
|
674 |
|
675 @page |
|
676 @contents |
|
677 @bye |