comparison doc/faq/FAQ.texi @ 2597:106ae3df29f5

[project @ 1996-12-17 17:48:01 by jwe]
author jwe
date Tue, 17 Dec 1996 17:48:02 +0000
parents b1a56412c385
children 20704e7e5e79
comparison
equal deleted inserted replaced
2596:7020b79afd9c 2597:106ae3df29f5
16 @setchapternewpage off 16 @setchapternewpage off
17 17
18 @titlepage 18 @titlepage
19 @title Octave FAQ 19 @title Octave FAQ
20 @subtitle Frequently asked questions about Octave 20 @subtitle Frequently asked questions about Octave
21 @subtitle December 1, 1994 21 @subtitle December 14, 1996
22 @sp 1 22 @sp 1
23 @author John W. Eaton 23 @author John W. Eaton
24 @page 24 @page
25 @end titlepage 25 @end titlepage
26 26
31 @cindex FAQ for Octave, latest version 31 @cindex FAQ for Octave, latest version
32 @end ifinfo 32 @end ifinfo
33 33
34 This is a list of frequently asked questions (FAQ) for Octave users. 34 This is a list of frequently asked questions (FAQ) for Octave users.
35 35
36 Some information in this FAQ was developed for earlier versions of 36 Some information in this FAQ was written for earlier versions of
37 Octave and may now be obsolete. 37 Octave and may now be obsolete.
38 38
39 I'm looking for new questions (@emph{with} answers), better answers, 39 I'm looking for new questions (@emph{with} answers), better answers,
40 or both. Please send suggestions to bug-octave@@bevo.che.wisc.edu. 40 or both. Please send suggestions to bug-octave@@bevo.che.wisc.edu.
41 If you have general questions about Octave, or need help for something 41 If you have general questions about Octave, or need help for something
42 that is not covered by the FAQ, please use the 42 that is not covered by the Octave manual or the FAQ, please use the
43 help-octave@@bevo.che.wisc.edu mailing list. 43 help-octave@@bevo.che.wisc.edu mailing list.
44 44
45 This FAQ is intended to supplement, not replace, the Octave manual. 45 This FAQ is intended to supplement, not replace, the Octave manual.
46 Before posting a question to the hlpe-octave mailing list, you should 46 Before posting a question to the help-octave mailing list, you should
47 first check to see if the topic is covered in the manual. 47 first check to see if the topic is covered in the manual.
48 48
49 @menu 49 @menu
50 * What is Octave?:: 50 * What is Octave?::
51 * Version 1.1.0:: 51 * Version 2.0::
52 * Octave Features:: 52 * Octave Features::
53 * Documentation:: 53 * Documentation::
54 * Getting Octave:: 54 * Getting Octave::
55 * Installation:: 55 * Installation::
56 * Common problems:: 56 * Common problems::
58 * Bug reports:: 58 * Bug reports::
59 * MATLAB compatibility:: 59 * MATLAB compatibility::
60 * Index:: 60 * Index::
61 @end menu 61 @end menu
62 62
63 @node What is Octave?, Version 1.1.0, Top, Top 63 @node What is Octave?, Version 2.0, Top, Top
64 @chapter What is Octave? 64 @chapter What is Octave?
65 65
66 Octave is a high-level interactive language, primarily intended for 66 Octave is a high-level interactive language, primarily intended for
67 numerical computations that is mostly compatible with 67 numerical computations that is mostly compatible with
68 @sc{Matlab}.@footnote{@sc{Matlab} is a registered trademark of The MathWorks, 68 @sc{Matlab}.@footnote{@sc{Matlab} is a registered trademark of The MathWorks,
95 95
96 Octave is also free software; you can redistribute it and/or modify it 96 Octave is also free software; you can redistribute it and/or modify it
97 under the terms of the GNU General Public License as published by the 97 under the terms of the GNU General Public License as published by the
98 Free Software Foundation. 98 Free Software Foundation.
99 99
100 @node Version 1.1.0, Octave Features, What is Octave?, Top 100 @node Version 2.0, Octave Features, What is Octave?, Top
101 @chapter What's new in version 1.1.0 of Octave 101 @chapter What's new in version 2.0 of Octave
102 102
103 The long-awaited version 1.1.0 of Octave has now been released. Many 103 The long-awaited version 2.0 of Octave has now been released. Many
104 bugs have been fixed and lots of new features added. Octave is now much 104 bugs have been fixed and lots of new features added. Octave is now much
105 more compatible with @sc{Matlab}. 105 more compatible with @sc{Matlab}.
106 106
107 Version 1.1.0 fixes many bugs, but as with any ``x.y.0'' release there 107 Version 2.0 fixes many bugs, but as with any ``x.y.0'' release there
108 will be a few glitches. You can expect a 1.1.1 shortly. You can help 108 will be a few glitches. There will probably be a 2.0.1 release to fix
109 contribute to the quality of Octave by trying it out and submitting bug 109 most of these problems. You can help contribute to the quality of
110 reports where you find them. 110 Octave by using it and submitting bug reports for the problems you
111 encounter.
111 112
112 A list of user-visible changes in recent versions of Octave may be found 113 A list of user-visible changes in recent versions of Octave may be found
113 in the file NEWS, distributed in both source and binary releases of 114 in the file NEWS, distributed in both source and binary releases of
114 Octave. 115 Octave.
115 116
116 @node Octave Features, Documentation, Version 1.1.0, Top 117 @node Octave Features, Documentation, Version 2.0, Top
117 @chapter What features are unique to Octave? 118 @chapter What features are unique to Octave?
118 119
119 @menu 120 @menu
120 * Command and variable name completion:: 121 * Command and variable name completion::
121 * Command history:: 122 * Command history::
179 180
180 @itemize @bullet 181 @itemize @bullet
181 @item Elements of structures can be of any value type. 182 @item Elements of structures can be of any value type.
182 183
183 @example 184 @example
185 @group
184 octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string"; 186 octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string";
185 octave:2> x.a 187 octave:2> x.a
186 x.a = 1 188 x.a = 1
187 octave:3> x.b 189 octave:3> x.b
188 x.b = 190 x.b =
190 1 2 192 1 2
191 3 4 193 3 4
192 194
193 octave:4> x.c 195 octave:4> x.c
194 x.c = string 196 x.c = string
197 @end group
195 @end example 198 @end example
196 199
197 @item Structures may be copied. 200 @item Structures may be copied.
198 201
199 @example 202 @example
203 @group
200 octave:1> y = x 204 octave:1> y = x
201 y = 205 y =
202 206 @{
203 <structure: a b c> 207 a = 1
208 b =
209
210 1 2
211 3 4
212
213 c = string
214 s =
215
216 0.00000 0.00000 0.00000
217 0.00000 5.46499 0.00000
218 0.00000 0.00000 0.36597
219
220 u =
221
222 -0.40455 -0.91451
223 -0.91451 0.40455
224
225 v =
226
227 -0.57605 0.81742
228 -0.81742 -0.57605
229 @}
230 @end group
204 @end example 231 @end example
205 232
206 @item Structure elements may reference other structures. 233 @item Structure elements may reference other structures.
207 234
208 @example 235 @example
236 @group
209 octave:1> x.b.d = 3 237 octave:1> x.b.d = 3
210 x.b.d = 3 238 x.b.d = 3
211 octave:2> x.b 239 octave:2> x.b
212 x.b = 240 ans =
213 241 @{
214 <structure: d> 242 d = 3
215 243 @}
216 octave:3> x.b.d 244 octave:3> x.b.d
217 x.b.d = 3 245 ans = 3
246 @end group
218 @end example 247 @end example
219 248
220 @item Functions can return structures. 249 @item Functions can return structures.
221 250
222 @example 251 @example
252 @group
223 octave:1> function y = f (x) 253 octave:1> function y = f (x)
224 > y.re = real (x); 254 > y.re = real (x);
225 > y.im = imag (x); 255 > y.im = imag (x);
226 > endfunction 256 > endfunction
227 257
228 octave:2> f (rand + rand*I); 258 octave:2> f (rand + rand*I);
229 ans = 259 ans =
230 260 @{
231 <structure: im re> 261 im = 0.18033
232 262 re = 0.19069
233 octave:3> ans.im, ans.re 263 @}
234 ans.im = 0.93411 264 @end group
235 ans.re = 0.56234
236 @end example 265 @end example
237 266
238 @item Function return lists can include structure elements, and they may 267 @item Function return lists can include structure elements, and they may
239 be indexed like any other variable. 268 be indexed like any other variable.
240 269
241 @example 270 @example
242 octave:1> [x.u, x.s(2:3,2:3), x.v] = svd ([1, 2; 3, 4]) 271 @group
243 x.u = 272 octave:1> [x.u, x.s(2:3,2:3), x.v] = svd ([1, 2; 3, 4]);
244 273 octave:2> x
245 -0.40455 -0.91451
246 -0.91451 0.40455
247
248 x.s =
249
250 0.00000 0.00000 0.00000
251 0.00000 5.46499 0.00000
252 0.00000 0.00000 0.36597
253
254 x.v =
255
256 -0.57605 0.81742
257 -0.81742 -0.57605
258
259 octave:8> x
260 x = 274 x =
261 275 @{
262 <structure: s u v> 276 s =
277
278 0.00000 0.00000 0.00000
279 0.00000 5.46499 0.00000
280 0.00000 0.00000 0.36597
281
282 u =
283
284 -0.40455 -0.91451
285 -0.91451 0.40455
286
287 v =
288
289 -0.57605 0.81742
290 -0.81742 -0.57605
291 @}
292 @end group
263 @end example 293 @end example
264 294
265 @item You can also use the function @code{is_struct} to determine 295 @item You can also use the function @code{is_struct} to determine
266 whether a given value is a data structure. For example 296 whether a given value is a data structure. For example
267 297
360 390
361 Here is an example of a function that uses the new syntax to print a 391 Here is an example of a function that uses the new syntax to print a
362 header followed by an unspecified number of values: 392 header followed by an unspecified number of values:
363 393
364 @example 394 @example
395 @group
365 function foo (heading, ...) 396 function foo (heading, ...)
366 disp (heading); 397 disp (heading);
367 va_start (); 398 va_start ();
368 while (--nargin) 399 while (--nargin)
369 disp (va_arg ()); 400 disp (va_arg ());
370 endwhile 401 endwhile
371 endfunction 402 endfunction
403 @end group
372 @end example 404 @end example
373 405
374 Calling @code{va_start()} positions an internal pointer to the first 406 Calling @code{va_start()} positions an internal pointer to the first
375 unnamed argument and allows you to cycle through the arguments more than 407 unnamed argument and allows you to cycle through the arguments more than
376 once. It is not necessary to call @code{va_start()} if you do not plan 408 once. It is not necessary to call @code{va_start()} if you do not plan
396 428
397 Here is an example of a function that uses the new syntax to produce 429 Here is an example of a function that uses the new syntax to produce
398 @samp{N} values: 430 @samp{N} values:
399 431
400 @example 432 @example
433 @group
401 function [...] = foo (n) 434 function [...] = foo (n)
402 for i = 1:n 435 for i = 1:n
403 vr_val (i); 436 vr_val (i);
404 endfor 437 endfor
405 endfunction 438 endfunction
439 @end group
406 @end example 440 @end example
407 441
408 @node Built-in ODE and DAE solvers, , Variable-length return lists, Octave Features 442 @node Built-in ODE and DAE solvers, , Variable-length return lists, Octave Features
409 @section Built-in ODE and DAE solvers 443 @section Built-in ODE and DAE solvers
410 444
411 @cindex DASSL 445 @cindex DASSL
412 @cindex LSODE 446 @cindex LSODE
413 447
414 Octave includes LSODE and DASSL for solving systems of stiff 448 Octave includes LSODE and DASSL for solving systems of stiff ordinary
415 differential and differential-algebraic equations. These functions are 449 differential and differential-algebraic equations. These functions are
416 built in to the interpreter. 450 built in to the interpreter.
417 451
418 @node Documentation, Getting Octave, Octave Features, Top 452 @node Documentation, Getting Octave, Octave Features, Top
419 @chapter What documentation exists for Octave? 453 @chapter What documentation exists for Octave?
431 Because the Octave manual is written using Texinfo, the complete text of 465 Because the Octave manual is written using Texinfo, the complete text of
432 the Octave manual is also available on line using the GNU Info system 466 the Octave manual is also available on line using the GNU Info system
433 via the GNU Emacs, info, or xinfo programs, or by using the @samp{help -i} 467 via the GNU Emacs, info, or xinfo programs, or by using the @samp{help -i}
434 command to start the GNU info browser directly from the Octave prompt. 468 command to start the GNU info browser directly from the Octave prompt.
435 469
436 It is also possible to use WWW browsers such as Mosaic to read the 470 It is also possible to use your favorite WWW browser to read the Octave
437 Octave manual (or any other Info file) by using Roar Smith's info2www 471 manual (or any other Info file) by using Roar Smith's info2www program
438 program to convert GNU Info files to HTML. The source for info2www is 472 to convert GNU Info files to HTML. The source for info2www is available
439 available via anonymous ftp from ftp.che.wisc.edu in the directory 473 from @url{ftp://ftp.che.wisc.edu/pub/www}.
440 @file{/pub/www}.
441 474
442 @node Getting Octave, Installation, Documentation, Top 475 @node Getting Octave, Installation, Documentation, Top
443 @chapter Obtaining Source Code 476 @chapter Obtaining Source Code
444 477
445 @cindex Source code 478 @cindex Source code
520 @node latest versions, , Octave for other platforms, Getting Octave 553 @node latest versions, , Octave for other platforms, Getting Octave
521 @section What is the latest version of Octave 554 @section What is the latest version of Octave
522 555
523 @cindex Octave, version date 556 @cindex Octave, version date
524 557
525 The latest version of Octave is 1.1.0, released January 1995. 558 The latest version of Octave is 2.0, released December 1996.
526 559
527 @node Installation, Common problems, Getting Octave, Top 560 @node Installation, Common problems, Getting Octave, Top
528 @chapter Installation Issues and Problems 561 @chapter Installation Issues and Problems
529 562
530 @cindex Octave, building 563 @cindex Octave, building
609 642
610 If you would like to join the discussion and receive all messages sent 643 If you would like to join the discussion and receive all messages sent
611 to the list, please send a short note to 644 to the list, please send a short note to
612 645
613 @example 646 @example
647 @group
614 help-octave-request@@bevo.che.wisc.edu 648 help-octave-request@@bevo.che.wisc.edu
615 ^^^^^^^ 649 ^^^^^^^
650 @end group
616 @end example 651 @end example
617 652
618 @strong{Please do not} send requests to be added or removed from the the 653 @strong{Please do not} send requests to be added or removed from the the
619 mailing list, or other administrative trivia to the list itself. 654 mailing list, or other administrative trivia to the list itself.
620 655
677 @item 712 @item
678 Unknown differences. 713 Unknown differences.
679 @end enumerate 714 @end enumerate
680 715
681 The first category, irrelevant differences, do not affect computations 716 The first category, irrelevant differences, do not affect computations
682 and most likely do not affect the execution of function files. Some 717 and most likely do not affect the execution of function files.
683 examples are:
684
685 When typing @samp{help function}, Octave displays the first set of
686 comment lines @emph{after} the function declaration, but @sc{Matlab}
687 the first set of comment lines starting from the beginning of the file.
688 718
689 The differences of the second category are usually because the authors 719 The differences of the second category are usually because the authors
690 of Octave decided on a better (subjective) implementation that the way 720 of Octave decided on a better (subjective) implementation that the way
691 @sc{Matlab} does it, and so introduced ``user preference variables'' so that 721 @sc{Matlab} does it, and so introduced ``user preference variables'' so that
692 you can customize Octave's behavior to be either @sc{Matlab}-compatible or 722 you can customize Octave's behavior to be either @sc{Matlab}-compatible or
693 to use Octave's new features. To make Octave more @sc{Matlab}-compatible, 723 to use Octave's new features. To make Octave more @sc{Matlab}-compatible,
694 put the following statements in your @file{~/.octaverc} file. This is a 724 put the following statements in your @file{~/.octaverc} file, or use the
695 partial list of the user preference variables that should be changed to 725 command line option @samp{--traditional}, which implies all of these
696 get @sc{Matlab}-compatible behavior. (It is partial because not all the 726 settings. Note that this list may not be complete, because some new
697 differences are currently known, and when they become known, this 727 variables may have been introduced since this document was last updated.
698 document lags behind.) 728
699 729 @example
700 @example 730 @group
701 PS1 = '>> '; 731 PS1 = ">> ";
702 PS2 = ''; 732 PS2 = "";
703 default_save_format = 'mat-binary'; 733 beep_on_error = 1;
704 define_all_return_values = 'true'; 734 default_save_format = "mat-binary";
705 do_fortran_indexing = 'true'; 735 define_all_return_values = 1;
706 empty_list_elements_ok = 'true'; 736 do_fortran_indexing = 1;
707 implicit_str_to_num_ok = 'true'; 737 empty_list_elements_ok = 1;
708 ok_to_lose_imaginary_part = 'true'; 738 implicit_str_to_num_ok = 1;
709 page_screen_output = 'false'; 739 ok_to_lose_imaginary_part = 1;
710 prefer_column_vectors = 'false'; 740 page_screen_output = 0;
711 prefer_zero_one_indexing = 'true'; 741 prefer_column_vectors = 0;
712 print_empty_dimensions = 'false'; 742 prefer_zero_one_indexing = 1;
713 treat_neg_dim_as_zero = 'true'; 743 print_empty_dimensions = 0;
714 warn_function_name_clash = 'false'; 744 treat_neg_dim_as_zero = 1;
715 whitespace_in_literal_matrix = 'traditional'; 745 warn_function_name_clash = 0;
746 whitespace_in_literal_matrix = "traditional";
747 @end group
716 @end example 748 @end example
717 749
718 Some other known differences are: 750 Some other known differences are:
719 751
720 @itemize @bullet 752 @itemize @bullet
721 @item
722 String subscripting is not yet implemented in Octave. For example,
723
724 @example
725 a = 'reknob';
726 a([6,1,5,3,2,4])
727 @end example
728
729 @noindent
730 returns the string @samp{broken} in @sc{Matlab}, but generates an error in
731 Octave. A future release of Octave will fix this along with providing
732 a much more complete and powerful set of functions for manipulating strings.
733
734 @item 753 @item
735 The Octave plotting functions are mostly compatible with the ones from 754 The Octave plotting functions are mostly compatible with the ones from
736 @sc{Matlab} 3.x, but not from @sc{Matlab} 4.x. 755 @sc{Matlab} 3.x, but not from @sc{Matlab} 4.x.
737
738 @item
739 The C-style I/O functions are not completely compatible. It would be
740 useful for someone to explore the differences so that they might be
741 fixed, or at least noted in the manual.
742 @end itemize 756 @end itemize
743 757
744 The third category of differences is (hopefully) shrinking. If you find 758 The third category of differences is (hopefully) shrinking. If you find
745 a difference between Octave behavior and @sc{Matlab}, then you should send a 759 a difference between Octave behavior and @sc{Matlab}, then you should send a
746 description of this difference (with code illustrating the difference, 760 description of this difference (with code illustrating the difference,