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