2845
|
1 Summary of changes for version 2.1: |
|
2 ---------------------------------- |
|
3 |
|
4 * It is now possible to declare static variables that retain their |
|
5 values across function calls. For example, |
|
6 |
|
7 function ncall = f () static n = 0; ncall = ++n; endfunction |
|
8 |
|
9 defines a function that returns the number of times that it has |
|
10 been called. |
2800
|
11 |
|
12 * Functions like quad, fsolve, and lsode can take either a function |
|
13 name or a simple function body as a string. For example, |
|
14 |
|
15 quad ("sqrt (x)", 0, 1) |
|
16 |
|
17 is equivalent to |
|
18 |
|
19 function y = f (x) y = sqrt (x); endfunction |
|
20 quad ("f", 0, 1) |
|
21 |
2815
|
22 * If the argument to eig() is symmetric, Octave uses the specialized |
|
23 Lapack subroutine for symmetric matrices for a significant |
|
24 increase in performance. |
|
25 |
2831
|
26 * Octave now has a logical data type. A true value is represented |
|
27 by 1, and false value by 0. Comparison operations like <, <=, ==, |
|
28 >, >=, and != now return logical values. Indexing operations that |
|
29 use zero-one style indexing must now use logical values. You can |
|
30 use the new function logical() to convert a numeric value to a |
|
31 logical value. This avoids the need for the built-in variable |
|
32 prefer_zero_one_indexing, so it has been removed. Logical values |
|
33 are automatically converted to numeric values where appropriate. |
|
34 |
2745
|
35 Summary of changes for version 2.0.5: |
|
36 ------------------------------------ |
|
37 |
2767
|
38 * A `switch' statement is now available. See the Statements chapter |
|
39 in the manual for details. |
|
40 |
2745
|
41 * Commands like ls, save, and cd may now also be used as formal |
|
42 parameters for functions. |
|
43 |
|
44 * More tests. |
|
45 |
2702
|
46 Summary of changes for version 2.0.4: |
|
47 ------------------------------------ |
|
48 |
|
49 * It is now possible to use commands like ls, save, and cd as simple |
|
50 variable names. They still cannot be used as formal parameters |
|
51 for functions, or as the names of structure variables. Failed |
|
52 assignments leave them undefined (you can recover the orginal |
2704
|
53 function definition using clear). |
|
54 |
|
55 * Is is now possible to invoke commands like ls, save, and cd as |
|
56 normal functions (for example, load ("foo", "x", "y", "z")). |
2702
|
57 |
2666
|
58 Summary of changes for version 2.0.3: |
|
59 ------------------------------------ |
|
60 |
|
61 * The manual has been completely revised and now corresponds much |
|
62 more closely to the features of the current version. |
|
63 |
|
64 * The return value for assignment expressions is now the RHS since |
|
65 that is more consistent with the way other programming languages |
|
66 work. However, Octave still prints the entire LHS value so that |
|
67 |
|
68 x = zeros (1, 2); |
|
69 x(2) = 1 |
|
70 |
|
71 still prints |
|
72 |
|
73 x = |
|
74 |
|
75 0 1 |
|
76 |
|
77 but an assignment like |
|
78 |
|
79 z = x(2) = 1 |
|
80 |
|
81 sets z to 1 (not [ 0, 1 ] as in previous versions of Octave). |
|
82 |
2683
|
83 * It is now much easier to make binary distributions. See the |
|
84 Binary Distributions section of the manual for more details. |
|
85 |
2615
|
86 Summary of changes for version 2.0.2: |
2613
|
87 ------------------------------------ |
|
88 |
2621
|
89 * Octave now stops executing commands from a script file if an error |
|
90 is encountered. |
|
91 |
|
92 * The return, and break commands now cause Octave to quit executing |
|
93 commands from script files. When used in invalid contexts, the |
|
94 break, continue, and return commands are now simply ignored |
|
95 instead of producing parse errors. |
|
96 |
2613
|
97 * size ("") is now [0, 0]. |
|
98 |
2634
|
99 * New functions: |
|
100 |
|
101 sleep -- pause execution for a specified number of seconds |
|
102 usleep -- pause execution for a specified number of microseconds |
|
103 |
2452
|
104 Summary of changes for version 2.0: |
|
105 ---------------------------------- |
|
106 |
2520
|
107 * The set and show commands for setting and displaying gnuplot |
|
108 parameters have been replaced by gset and gshow. This change will |
|
109 probably break lots of things, but it is necessary to allow for |
|
110 compatibility with the Matlab graphics and GUI commands in a |
|
111 future version of Octave. (For now, the old set and show commands |
|
112 do work, but they print an annoying warning message to try to get |
|
113 people to switch to using gset.) |
|
114 |
2581
|
115 * Octave has been mostly ported to Windows NT and Windows 95 using |
|
116 the beta 17 release of the Cygnus GNU-WIN32 tools. Not everything |
|
117 works, but it is usable. See the file README.WINDOWS for more |
|
118 information. |
|
119 |
2580
|
120 * Dynamic linking works on more systems using dlopen() and friends |
|
121 (most modern Unix systems) or shl_load() and friends (HP/UX |
|
122 systems). A simple example is provided in examples/hello.cc. |
|
123 For this feature to work, you must configure Octave with |
|
124 --enable-shared. You may also need to have a shared-library |
|
125 version of libg++ and libstdc++. |
|
126 |
2452
|
127 * New data types can be added to Octave by writing a C++ class. On |
|
128 systems that support dynamic linking, new data types can be added |
|
129 to an already running Octave binary. A simple example appears in |
|
130 the file examples/make_int.cc. Other examples are the standard |
|
131 Octave data types defined in the files src/ov*.{h,cc} and |
2580
|
132 src/op-*.cc. |
2452
|
133 |
|
134 * The configure option --enable-bounds-check turns on bounds |
|
135 checking on element references for Octave's internal array and |
|
136 matrix classes. It's enabled by default. To disable this |
|
137 feature, configure Octave with --disable-bounds-check. |
|
138 |
|
139 * The C-style I/O functions (fopen, fprintf, etc.) have been |
|
140 rewritten to be more compatible with Matlab. The fputs function |
|
141 has also been added. Usage of the *printf functions that was |
|
142 allowed in previous versions of Octave should still work. |
|
143 However, there is no way to make the new versions of the *scanf |
|
144 functions compatible with Matlab *and* previous versions of |
|
145 Octave. An optional argument to the *scanf functions is now |
|
146 available to make them behave in a way that is compatible with |
|
147 previous versions of Octave. |
|
148 |
2511
|
149 * Octave can now read files that contain columns of numbers only, |
|
150 with no header information. The name of the loaded variable is |
|
151 constructed from the file name. Each line in the file must have |
|
152 the same number of elements. |
|
153 |
2452
|
154 * The interface to the pager has changed. The new built-in variable |
|
155 `page_output_immediately' controls when Octave sends output to the |
|
156 pager. If it is nonzero, Octave sends output to the pager as soon |
|
157 as it is available. Otherwise, Octave buffers its output and |
|
158 waits until just before the prompt is printed to flush it to the |
|
159 pager. |
|
160 |
|
161 * Expressions of the form |
|
162 |
|
163 A(i,j) = x |
|
164 |
|
165 where X is a scalar and the indices i and j define a matrix of |
|
166 elements now work as you would expect rather than giving an error. |
|
167 I am told that this is how Matlab 5.0 will behave when it is |
|
168 released. |
|
169 |
|
170 * Indexing of character strings now works. |
|
171 |
|
172 * The echo command has been implemented. |
|
173 |
|
174 * The document command is now a regular function. |
|
175 |
|
176 * New method for handling errors: |
|
177 |
|
178 try |
|
179 BODY |
|
180 catch |
|
181 CLEANUP |
|
182 end_try_catch |
|
183 |
|
184 Where BODY and CLEANUP are both optional and may contain any |
|
185 Octave expressions or commands. The statements in CLEANUP are |
|
186 only executed if an error occurs in BODY. |
|
187 |
|
188 No warnings or error messages are printed while BODY is |
|
189 executing. If an error does occur during the execution of BODY, |
|
190 CLEANUP can access the text of the message that would have been |
|
191 printed in the builtin constant __error_text__. This is the same |
|
192 as eval (TRY, CATCH) (which may now also use __error_text__) but |
|
193 it is more efficient since the commands do not need to be parsed |
|
194 each time the TRY and CATCH statements are evaluated. |
|
195 |
|
196 * Octave no longer parses the help command by grabbing everything |
|
197 after the keyword `help' until a newline character is read. To |
|
198 get help for `;' or `,', now, you need to use the command |
|
199 `help semicolon' or `help comma'. |
|
200 |
|
201 * Octave's parser now does some simple constant folding. This means |
|
202 that expressions like 3*i are now evaluated only once, when a |
|
203 function is compiled, and the right hand side of expressions like |
|
204 a = [1,2;3,4] are treated as true matrix constants rather than |
|
205 lists of elements which must be evaluated each time they are |
|
206 needed. |
|
207 |
|
208 * Built-in variables that can take values of "true" and "false" can |
|
209 now also be set to any nonzero scalar value to indicate "true", |
|
210 and 0 to indicate "false". |
|
211 |
|
212 * New built-in variables `history_file', `history_size', and |
|
213 `saving_history'. |
|
214 |
|
215 * New built-in variable `string_fill_char' specifies the character |
|
216 to fill with when creating arrays of strings. |
|
217 |
|
218 * If the new built-in variable `gnuplot_has_frames' is nonzero, |
|
219 Octave assumes that your copy of gnuplot includes support for |
|
220 multiple plot windows when using X11. |
|
221 |
|
222 If the new built-in variable `gnuplot_has_multiplot' is nonzero, |
|
223 Octave assumes that your copy of gnuplot has the multiplot support |
|
224 that is included in recent 3.6beta releases. |
|
225 |
|
226 The initial values of these variables are determined by configure, |
|
227 but can be changed in your startup script or at the command line |
|
228 in case configure got it wrong, or if you upgrade your gnuplot |
|
229 installation. |
|
230 |
|
231 * The new plot function `figure' allows multiple plot windows when |
|
232 using newer versions of gnuplot with X11. |
|
233 |
|
234 * Octave now notices when the plotter has exited unexpectedly. |
|
235 |
|
236 * New built-in variable `warn_missing_semicolon'. If nonzero, Octave |
|
237 will warn when statements in function definitions don't end in |
|
238 semicolons. The default value is 0. |
|
239 |
|
240 * Octave now attempts to continue after floating point exceptions |
|
241 or out-of-memory errors. |
|
242 |
|
243 * If Octave crashes, it now attempts to save all user-defined |
|
244 variables in a file named `octave-core' in the current directory |
|
245 before exiting. |
|
246 |
|
247 * It is now possible to get the values of individual option settings |
|
248 for the dassl, fsolve, lsode, npsol, qpsol, and quad functions |
|
249 using commands like |
|
250 |
|
251 dassl_reltol = dassl_options ("relative tolerance"); |
|
252 |
|
253 * The svd() function no longer computes the left and right singular |
|
254 matrices unnecessarily. This can significantly improve |
|
255 performance for large matrices if you are just looking for the |
|
256 singular values. |
|
257 |
|
258 * The filter() function is now a built-in function. |
|
259 |
|
260 * New function randn() returns a pseudo-random number from a normal |
|
261 distribution. The rand() and randn() functions have separate |
|
262 seeds and generators. |
|
263 |
|
264 * Octave's command-line arguments are now available in the built-in |
|
265 variable `argv'. The program name is also available in the |
|
266 variables `program_invocation_name' and `program_name'. If |
|
267 executing a script from the command line (e.g., octave foo.m) or |
|
268 using the `#! /bin/octave' hack, the program name is set to the |
|
269 name of the script. |
|
270 |
|
271 * New built-in variable `completion_append_char' used as the |
|
272 character to append to successful command-line completion |
|
273 attempts. The default is " " (a single space). |
|
274 |
|
275 * Octave now uses a modified copy of the readline library from |
|
276 version 1.14.5 of GNU bash. |
|
277 |
|
278 * In prompt strings, `\H' expands to the whole host name. |
|
279 |
|
280 * New built-in variable `beep_on_error'. If nonzero, Octave will try |
|
281 to ring your terminal's bell before printing an error message. |
|
282 The default value is 0. |
|
283 |
2554
|
284 * For functions defined from files, the type command now prints the |
|
285 text of the file. You can still get the text reconstructed from |
|
286 the parse tree by using the new option -t (-transformed). |
|
287 |
2452
|
288 * New command-line argument --traditional sets the following |
|
289 preference variables for compatibility with Matlab: |
|
290 |
|
291 PS1 = ">> " |
|
292 PS2 = "" |
|
293 beep_on_error = 1 |
|
294 default_save_format = "mat-binary" |
|
295 define_all_return_values = 1 |
|
296 do_fortran_indexing = 1 |
|
297 empty_list_elements_ok = 1 |
|
298 implicit_str_to_num_ok = 1 |
|
299 ok_to_lose_imaginary_part = 1 |
|
300 page_screen_output = 0 |
|
301 prefer_column_vectors = 0 |
|
302 prefer_zero_one_indexing = 1 |
|
303 print_empty_dimensions = 0 |
|
304 treat_neg_dim_as_zero = 1 |
|
305 warn_function_name_clash = 0 |
|
306 whitespace_in_literal_matrix = "traditional" |
|
307 |
|
308 * New functions: |
|
309 |
|
310 readdir -- returns names of files in directory as array of strings |
|
311 mkdir -- create a directory |
|
312 rmdir -- remove a directory |
|
313 rename -- rename a file |
|
314 unlink -- delete a file |
|
315 umask -- set permission mask for file creation |
|
316 stat -- get information about a file |
|
317 lstat -- get information about a symbolic link |
2496
|
318 glob -- perform filename globbing |
|
319 fnmatch -- match strings with filename globbing patterns |
2452
|
320 more -- turn the pager on or off |
|
321 gammaln -- alias for lgamma |
|
322 |
|
323 * New audio functions from Andreas Weingessel |
|
324 <Andreas.Weingessel@ci.tuwien.ac.at>. |
|
325 |
2458
|
326 lin2mu -- linear to mu-law encoding |
|
327 loadaudio -- load an audio file to a vector |
|
328 mu2lin -- mu-law to linear encoding |
|
329 playaudio -- play an audio file |
|
330 record -- record sound and store in vector |
|
331 saveaudio -- save a vector as an audio file |
|
332 setaudio -- executes mixer shell command |
2452
|
333 |
|
334 * New plotting functions from Vinayak Dutt. Ones dealing with |
|
335 multiple plots on one page require features from gnuplot 3.6beta |
|
336 (or later). |
|
337 |
|
338 bottom_title -- put title at the bottom of the plot |
|
339 mplot -- multiplot version of plot |
|
340 multiplot -- switch multiple-plot mode on or off |
|
341 oneplot -- return to one plot per page |
|
342 plot_border -- put a border around plots |
|
343 subplot -- position multiple plots on a single page |
|
344 subwindow -- set subwindow position for next plot |
|
345 top_title -- put title at the top of the plot |
|
346 zlabel -- put a label on the z-axis |
|
347 |
|
348 * New string functions |
|
349 |
|
350 bin2dec -- convert a string of ones and zeros to an integer |
|
351 blanks -- create a string of blanks |
|
352 deblank -- delete trailing blanks |
|
353 dec2bin -- convert an integer to a string of ones and zeros |
|
354 dec2hex -- convert an integer to a hexadecimal string |
|
355 findstr -- locate occurrences of one string in another |
|
356 hex2dec -- convert a hexadecimal string to an integer |
|
357 index -- return position of first occurrence a string in another |
|
358 rindex -- return position of last occurrence a string in another |
|
359 split -- divide one string into pieces separated by another |
|
360 str2mat -- create a string matrix from a list of strings |
|
361 strrep -- replace substrings in a string |
|
362 substr -- extract a substring |
|
363 |
|
364 The following functions return a matrix of ones and zeros. |
|
365 Elements that are nonzero indicate that the condition was true for |
|
366 the corresponding character in the string array. |
|
367 |
|
368 isalnum -- letter or a digit |
|
369 isalpha -- letter |
|
370 isascii -- ascii |
|
371 iscntrl -- control character |
|
372 isdigit -- digit |
|
373 isgraph -- printable (but not space character) |
|
374 islower -- lower case |
|
375 isprint -- printable (including space character) |
|
376 ispunct -- punctuation |
|
377 isspace -- whitespace |
|
378 isupper -- upper case |
|
379 isxdigit -- hexadecimal digit |
|
380 |
|
381 These functions return new strings. |
|
382 |
2458
|
383 tolower -- convert to lower case |
|
384 toupper -- convert to upper case |
2452
|
385 |
|
386 * New function, fgetl. Both fgetl and fgets accept an optional |
|
387 second argument that specifies a maximum number of characters to |
|
388 read, and the function fgets is now compatible with Matlab. |
|
389 |
|
390 * Printing in hexadecimal format now works (format hex). It is also |
|
391 possible to print the internal bit representation of a value |
|
392 (format bit). Note that these formats are only implemented for |
|
393 numeric values. |
|
394 |
|
395 * Additional structure features: |
|
396 |
|
397 -- Name completion now works for structures. |
|
398 |
|
399 -- Values and names of structure elements are now printed by |
|
400 default. The new built-in variable `struct_levels_to_print' |
|
401 controls the depth of nested structures to print. The default |
|
402 value is 2. |
|
403 |
|
404 -- New functions: |
|
405 |
|
406 struct_contains (S, NAME) -- returns 1 if S is a structure with |
|
407 element NAME; otherwise returns 0. |
|
408 |
|
409 struct_elements (S) -- returns the names of all elements |
|
410 of structure S in an array of strings. |
|
411 |
|
412 * New io/subprocess functions: |
|
413 |
2458
|
414 fputs -- write a string to a file with no formatting |
|
415 popen2 -- start a subprocess with 2-way communication |
|
416 mkfifo -- create a FIFO special file |
|
417 popen -- open a pipe to a subprocess |
|
418 pclose -- close a pipe from a subprocess |
|
419 waitpid -- check the status of or wait for subprocesses |
2452
|
420 |
|
421 * New time functions: |
|
422 |
2458
|
423 asctime -- format time structure according to local format |
|
424 ctime -- equivalent to `asctime (localtime (TMSTRUCT))' |
|
425 gmtime -- return time structure corresponding to UTC |
|
426 localtime -- return time structure corresponding to local time zone |
|
427 strftime -- print given time structure using specified format |
|
428 time -- return current time |
2452
|
429 |
|
430 The `clock' and `date' functions are now implemented in M-files |
|
431 using these basic functions. |
|
432 |
|
433 * Access to additional Unix system calls: |
|
434 |
|
435 dup2 -- duplicate a file descriptor |
|
436 exec -- replace current process with a new process |
|
437 fcntl -- control open file descriptors |
|
438 fork -- create a copy of the current process |
|
439 getpgrp -- return the process group id of the current process |
|
440 getpid -- return the process id of the current process |
|
441 getppid -- return the process id of the parent process |
2475
|
442 getuid -- return the real user id of the current process |
|
443 getgid -- return the real group id of the current process |
|
444 geteuid -- return the effective user id of the current process |
|
445 getegid -- return the effective group id of the current process |
2452
|
446 pipe -- create an interprocess channel |
|
447 |
|
448 * Other new functions: |
|
449 |
2554
|
450 commutation_matrix -- compute special matrix form |
|
451 duplication_matrix -- compute special matrix form |
|
452 common_size.m -- bring arguments to a common size |
|
453 completion_matches -- perform command completion on string |
2458
|
454 tilde_expand -- perform tilde expansion on string |
2554
|
455 |
|
456 meshgrid -- compatible with Matlab's meshgrid function |
|
457 tmpnam -- replaces octave_tmp_file_name |
|
458 atexit -- register functions to be called when Octave exits |
|
459 putenv -- define an environment variable |
|
460 bincoeff -- compute binomial coefficients |
|
461 nextpow2 -- compute the next power of 2 greater than a number |
|
462 detrend -- remove a best fit polynomial from data |
|
463 erfinv -- inverse error function |
|
464 shift -- perform a circular shift on the elements of a matrix |
|
465 pow2 -- compute 2 .^ x |
|
466 log2 -- compute base 2 logarithms |
|
467 diff -- compute differences of matrix elements |
|
468 vech -- stack columns of a matrix below the diagonal |
|
469 vec -- stack columns of a matrix to form a vector |
|
470 xor -- compute exclusive or |
2452
|
471 |
2459
|
472 * Functions for getting info from the password database on Unix systems: |
|
473 |
|
474 getpwent -- read entry from password-file stream, opening if necessary |
|
475 getpwuid -- search for password entry with matching user ID |
|
476 getpwnam -- search for password entry with matching username |
|
477 setpwent -- rewind the password-file stream |
|
478 endpwent -- close the password-file stream |
|
479 |
2484
|
480 * Functions for getting info from the group database on Unix systems: |
|
481 |
|
482 getgrent -- read entry from group-file stream, opening if necessary |
|
483 getgrgid -- search for group entry with matching group ID |
|
484 getgrnam -- search for group entry with matching group name |
|
485 setgrent -- rewind the pgroup-file stream |
|
486 endgrent -- close the group-file stream |
|
487 |
2452
|
488 * The New function octave_config_info returns a structure containing |
|
489 information about how Octave was configured and compiled. |
|
490 |
|
491 * New function getrusage returns a structure containing system |
|
492 resource usage statistics. The `cputime' function is now defined |
|
493 in an M-file using getrusage. |
|
494 |
|
495 * The info reader is now a separate binary that runs as a |
|
496 subprocess. You still need the info reader distributed with |
|
497 Octave though, because there are some new command-line arguments |
|
498 that are not yet available in the public release of Info. |
|
499 |
|
500 * There is a new built-in variable, INFO_PROGRAM, which is used as |
|
501 the name of the info program to run. Its initial value is |
|
502 $OCTAVE_HOME/lib/octave/VERSION/exec/ARCH/info, but that value can |
|
503 be overridden by the environment variable OCTAVE_INFO_PROGRAM, or |
|
504 the command line argument --info-program NAME, or by setting the |
|
505 value of INFO_PROGRAM in a startup script. |
|
506 |
|
507 * There is a new built-in variable, EXEC_PATH, which is used as |
|
508 the list of directories to search when executing subprograms. Its |
|
509 initial value is taken from the environment variable |
|
510 OCTAVE_EXEC_PATH (if it exists) or PATH, but that value can be |
|
511 overridden by the the command line argument --exec-path PATH, or |
|
512 by setting the value of EXEC_PATH in a startup script. If the |
|
513 EXEC_PATH begins (ends) with a colon, the directories |
|
514 $OCTAVE_HOME/lib/octave/VERSION/exec/ARCH and $OCTAVE_HOME/bin are |
|
515 prepended (appended) to EXEC_PATH (if you don't specify a value |
|
516 for EXEC_PATH explicitly, these special directories are prepended |
|
517 to your PATH). |
|
518 |
|
519 * If it is present, Octave will now use an `ls-R' database file to |
|
520 speed up recursive path searching. Octave looks for a file called |
|
521 ls-R in the directory specified by the environment variable |
|
522 OCTAVE_DB_DIR. If that is not set but the environment variable |
|
523 OCTAVE_HOME is set, Octave looks in $OCTAVE_HOME/lib/octave. |
|
524 Otherwise, Octave looks in the directory $datadir/octave (normally |
|
525 /usr/local/lib/octave). |
|
526 |
|
527 * New examples directory. |
|
528 |
|
529 * There is a new script, mkoctfile, that can be used to create .oct |
|
530 files suitable for dynamic linking. |
|
531 |
|
532 * Many more bug fixes. |
|
533 |
|
534 * ChangeLogs are now kept in each subdirectory. |
|
535 |
|
536 See NEWS.1 for old news. |