2452
|
1 Summary of changes for version 2.0: |
|
2 ---------------------------------- |
|
3 |
|
4 * New data types can be added to Octave by writing a C++ class. On |
|
5 systems that support dynamic linking, new data types can be added |
|
6 to an already running Octave binary. A simple example appears in |
|
7 the file examples/make_int.cc. Other examples are the standard |
|
8 Octave data types defined in the files src/ov*.{h,cc} and |
|
9 src/op-*.cc. [This feature should be better documented by the |
|
10 time 2.0 is released]. |
|
11 |
|
12 * The configure option --enable-bounds-check turns on bounds |
|
13 checking on element references for Octave's internal array and |
|
14 matrix classes. It's enabled by default. To disable this |
|
15 feature, configure Octave with --disable-bounds-check. |
|
16 |
|
17 * The C-style I/O functions (fopen, fprintf, etc.) have been |
|
18 rewritten to be more compatible with Matlab. The fputs function |
|
19 has also been added. Usage of the *printf functions that was |
|
20 allowed in previous versions of Octave should still work. |
|
21 However, there is no way to make the new versions of the *scanf |
|
22 functions compatible with Matlab *and* previous versions of |
|
23 Octave. An optional argument to the *scanf functions is now |
|
24 available to make them behave in a way that is compatible with |
|
25 previous versions of Octave. |
|
26 |
|
27 * The interface to the pager has changed. The new built-in variable |
|
28 `page_output_immediately' controls when Octave sends output to the |
|
29 pager. If it is nonzero, Octave sends output to the pager as soon |
|
30 as it is available. Otherwise, Octave buffers its output and |
|
31 waits until just before the prompt is printed to flush it to the |
|
32 pager. |
|
33 |
|
34 * Expressions of the form |
|
35 |
|
36 A(i,j) = x |
|
37 |
|
38 where X is a scalar and the indices i and j define a matrix of |
|
39 elements now work as you would expect rather than giving an error. |
|
40 I am told that this is how Matlab 5.0 will behave when it is |
|
41 released. |
|
42 |
|
43 * Indexing of character strings now works. |
|
44 |
|
45 * The echo command has been implemented. |
|
46 |
|
47 * The document command is now a regular function. |
|
48 |
|
49 * New method for handling errors: |
|
50 |
|
51 try |
|
52 BODY |
|
53 catch |
|
54 CLEANUP |
|
55 end_try_catch |
|
56 |
|
57 Where BODY and CLEANUP are both optional and may contain any |
|
58 Octave expressions or commands. The statements in CLEANUP are |
|
59 only executed if an error occurs in BODY. |
|
60 |
|
61 No warnings or error messages are printed while BODY is |
|
62 executing. If an error does occur during the execution of BODY, |
|
63 CLEANUP can access the text of the message that would have been |
|
64 printed in the builtin constant __error_text__. This is the same |
|
65 as eval (TRY, CATCH) (which may now also use __error_text__) but |
|
66 it is more efficient since the commands do not need to be parsed |
|
67 each time the TRY and CATCH statements are evaluated. |
|
68 |
|
69 * Octave no longer parses the help command by grabbing everything |
|
70 after the keyword `help' until a newline character is read. To |
|
71 get help for `;' or `,', now, you need to use the command |
|
72 `help semicolon' or `help comma'. |
|
73 |
|
74 * Octave's parser now does some simple constant folding. This means |
|
75 that expressions like 3*i are now evaluated only once, when a |
|
76 function is compiled, and the right hand side of expressions like |
|
77 a = [1,2;3,4] are treated as true matrix constants rather than |
|
78 lists of elements which must be evaluated each time they are |
|
79 needed. |
|
80 |
|
81 * Built-in variables that can take values of "true" and "false" can |
|
82 now also be set to any nonzero scalar value to indicate "true", |
|
83 and 0 to indicate "false". |
|
84 |
|
85 * New built-in variables `history_file', `history_size', and |
|
86 `saving_history'. |
|
87 |
|
88 * New built-in variable `string_fill_char' specifies the character |
|
89 to fill with when creating arrays of strings. |
|
90 |
|
91 * If the new built-in variable `gnuplot_has_frames' is nonzero, |
|
92 Octave assumes that your copy of gnuplot includes support for |
|
93 multiple plot windows when using X11. |
|
94 |
|
95 If the new built-in variable `gnuplot_has_multiplot' is nonzero, |
|
96 Octave assumes that your copy of gnuplot has the multiplot support |
|
97 that is included in recent 3.6beta releases. |
|
98 |
|
99 The initial values of these variables are determined by configure, |
|
100 but can be changed in your startup script or at the command line |
|
101 in case configure got it wrong, or if you upgrade your gnuplot |
|
102 installation. |
|
103 |
|
104 * The new plot function `figure' allows multiple plot windows when |
|
105 using newer versions of gnuplot with X11. |
|
106 |
|
107 * Octave now notices when the plotter has exited unexpectedly. |
|
108 |
|
109 * New built-in variable `warn_missing_semicolon'. If nonzero, Octave |
|
110 will warn when statements in function definitions don't end in |
|
111 semicolons. The default value is 0. |
|
112 |
|
113 * Octave now attempts to continue after floating point exceptions |
|
114 or out-of-memory errors. |
|
115 |
|
116 * If Octave crashes, it now attempts to save all user-defined |
|
117 variables in a file named `octave-core' in the current directory |
|
118 before exiting. |
|
119 |
|
120 * It is now possible to get the values of individual option settings |
|
121 for the dassl, fsolve, lsode, npsol, qpsol, and quad functions |
|
122 using commands like |
|
123 |
|
124 dassl_reltol = dassl_options ("relative tolerance"); |
|
125 |
|
126 * The svd() function no longer computes the left and right singular |
|
127 matrices unnecessarily. This can significantly improve |
|
128 performance for large matrices if you are just looking for the |
|
129 singular values. |
|
130 |
|
131 * The filter() function is now a built-in function. |
|
132 |
|
133 * New function randn() returns a pseudo-random number from a normal |
|
134 distribution. The rand() and randn() functions have separate |
|
135 seeds and generators. |
|
136 |
|
137 * Octave's command-line arguments are now available in the built-in |
|
138 variable `argv'. The program name is also available in the |
|
139 variables `program_invocation_name' and `program_name'. If |
|
140 executing a script from the command line (e.g., octave foo.m) or |
|
141 using the `#! /bin/octave' hack, the program name is set to the |
|
142 name of the script. |
|
143 |
|
144 * New built-in variable `completion_append_char' used as the |
|
145 character to append to successful command-line completion |
|
146 attempts. The default is " " (a single space). |
|
147 |
|
148 * Octave now uses a modified copy of the readline library from |
|
149 version 1.14.5 of GNU bash. |
|
150 |
|
151 * In prompt strings, `\H' expands to the whole host name. |
|
152 |
|
153 * New built-in variable `beep_on_error'. If nonzero, Octave will try |
|
154 to ring your terminal's bell before printing an error message. |
|
155 The default value is 0. |
|
156 |
|
157 * New command-line argument --traditional sets the following |
|
158 preference variables for compatibility with Matlab: |
|
159 |
|
160 PS1 = ">> " |
|
161 PS2 = "" |
|
162 beep_on_error = 1 |
|
163 default_save_format = "mat-binary" |
|
164 define_all_return_values = 1 |
|
165 do_fortran_indexing = 1 |
|
166 empty_list_elements_ok = 1 |
|
167 implicit_str_to_num_ok = 1 |
|
168 ok_to_lose_imaginary_part = 1 |
|
169 page_screen_output = 0 |
|
170 prefer_column_vectors = 0 |
|
171 prefer_zero_one_indexing = 1 |
|
172 print_empty_dimensions = 0 |
|
173 treat_neg_dim_as_zero = 1 |
|
174 warn_function_name_clash = 0 |
|
175 whitespace_in_literal_matrix = "traditional" |
|
176 |
|
177 * New functions: |
|
178 |
|
179 readdir -- returns names of files in directory as array of strings |
|
180 mkdir -- create a directory |
|
181 rmdir -- remove a directory |
|
182 rename -- rename a file |
|
183 unlink -- delete a file |
|
184 umask -- set permission mask for file creation |
|
185 stat -- get information about a file |
|
186 lstat -- get information about a symbolic link |
2496
|
187 glob -- perform filename globbing |
|
188 fnmatch -- match strings with filename globbing patterns |
2452
|
189 more -- turn the pager on or off |
|
190 gammaln -- alias for lgamma |
|
191 |
|
192 * New audio functions from Andreas Weingessel |
|
193 <Andreas.Weingessel@ci.tuwien.ac.at>. |
|
194 |
2458
|
195 lin2mu -- linear to mu-law encoding |
|
196 loadaudio -- load an audio file to a vector |
|
197 mu2lin -- mu-law to linear encoding |
|
198 playaudio -- play an audio file |
|
199 record -- record sound and store in vector |
|
200 saveaudio -- save a vector as an audio file |
|
201 setaudio -- executes mixer shell command |
2452
|
202 |
|
203 * New plotting functions from Vinayak Dutt. Ones dealing with |
|
204 multiple plots on one page require features from gnuplot 3.6beta |
|
205 (or later). |
|
206 |
|
207 bottom_title -- put title at the bottom of the plot |
|
208 mplot -- multiplot version of plot |
|
209 multiplot -- switch multiple-plot mode on or off |
|
210 oneplot -- return to one plot per page |
|
211 plot_border -- put a border around plots |
|
212 subplot -- position multiple plots on a single page |
|
213 subwindow -- set subwindow position for next plot |
|
214 top_title -- put title at the top of the plot |
|
215 zlabel -- put a label on the z-axis |
|
216 |
|
217 * New string functions |
|
218 |
|
219 bin2dec -- convert a string of ones and zeros to an integer |
|
220 blanks -- create a string of blanks |
|
221 deblank -- delete trailing blanks |
|
222 dec2bin -- convert an integer to a string of ones and zeros |
|
223 dec2hex -- convert an integer to a hexadecimal string |
|
224 findstr -- locate occurrences of one string in another |
|
225 hex2dec -- convert a hexadecimal string to an integer |
|
226 index -- return position of first occurrence a string in another |
|
227 rindex -- return position of last occurrence a string in another |
|
228 split -- divide one string into pieces separated by another |
|
229 str2mat -- create a string matrix from a list of strings |
|
230 strrep -- replace substrings in a string |
|
231 substr -- extract a substring |
|
232 |
|
233 The following functions return a matrix of ones and zeros. |
|
234 Elements that are nonzero indicate that the condition was true for |
|
235 the corresponding character in the string array. |
|
236 |
|
237 isalnum -- letter or a digit |
|
238 isalpha -- letter |
|
239 isascii -- ascii |
|
240 iscntrl -- control character |
|
241 isdigit -- digit |
|
242 isgraph -- printable (but not space character) |
|
243 islower -- lower case |
|
244 isprint -- printable (including space character) |
|
245 ispunct -- punctuation |
|
246 isspace -- whitespace |
|
247 isupper -- upper case |
|
248 isxdigit -- hexadecimal digit |
|
249 |
|
250 These functions return new strings. |
|
251 |
2458
|
252 tolower -- convert to lower case |
|
253 toupper -- convert to upper case |
2452
|
254 |
|
255 * New function, fgetl. Both fgetl and fgets accept an optional |
|
256 second argument that specifies a maximum number of characters to |
|
257 read, and the function fgets is now compatible with Matlab. |
|
258 |
|
259 * Printing in hexadecimal format now works (format hex). It is also |
|
260 possible to print the internal bit representation of a value |
|
261 (format bit). Note that these formats are only implemented for |
|
262 numeric values. |
|
263 |
|
264 * Additional structure features: |
|
265 |
|
266 -- Name completion now works for structures. |
|
267 |
|
268 -- Values and names of structure elements are now printed by |
|
269 default. The new built-in variable `struct_levels_to_print' |
|
270 controls the depth of nested structures to print. The default |
|
271 value is 2. |
|
272 |
|
273 -- New functions: |
|
274 |
|
275 struct_contains (S, NAME) -- returns 1 if S is a structure with |
|
276 element NAME; otherwise returns 0. |
|
277 |
|
278 struct_elements (S) -- returns the names of all elements |
|
279 of structure S in an array of strings. |
|
280 |
|
281 * New io/subprocess functions: |
|
282 |
2458
|
283 fputs -- write a string to a file with no formatting |
|
284 popen2 -- start a subprocess with 2-way communication |
|
285 mkfifo -- create a FIFO special file |
|
286 popen -- open a pipe to a subprocess |
|
287 pclose -- close a pipe from a subprocess |
|
288 waitpid -- check the status of or wait for subprocesses |
2452
|
289 |
|
290 * New time functions: |
|
291 |
2458
|
292 asctime -- format time structure according to local format |
|
293 ctime -- equivalent to `asctime (localtime (TMSTRUCT))' |
|
294 gmtime -- return time structure corresponding to UTC |
|
295 localtime -- return time structure corresponding to local time zone |
|
296 strftime -- print given time structure using specified format |
|
297 time -- return current time |
2452
|
298 |
|
299 The `clock' and `date' functions are now implemented in M-files |
|
300 using these basic functions. |
|
301 |
|
302 * Access to additional Unix system calls: |
|
303 |
|
304 dup2 -- duplicate a file descriptor |
|
305 exec -- replace current process with a new process |
|
306 fcntl -- control open file descriptors |
|
307 fork -- create a copy of the current process |
|
308 getpgrp -- return the process group id of the current process |
|
309 getpid -- return the process id of the current process |
|
310 getppid -- return the process id of the parent process |
2475
|
311 getuid -- return the real user id of the current process |
|
312 getgid -- return the real group id of the current process |
|
313 geteuid -- return the effective user id of the current process |
|
314 getegid -- return the effective group id of the current process |
2452
|
315 pipe -- create an interprocess channel |
|
316 |
|
317 * Other new functions: |
|
318 |
2458
|
319 tmpnam -- replaces octave_tmp_file_name |
|
320 atexit -- register functions to be called when Octave exits |
|
321 putenv -- define an environment variable |
|
322 meshgrid -- compatible with Matlab's meshgrid function |
|
323 tilde_expand -- perform tilde expansion on string |
|
324 completion_matches -- perform command completion on string |
2452
|
325 |
2459
|
326 * Functions for getting info from the password database on Unix systems: |
|
327 |
|
328 getpwent -- read entry from password-file stream, opening if necessary |
|
329 getpwuid -- search for password entry with matching user ID |
|
330 getpwnam -- search for password entry with matching username |
|
331 setpwent -- rewind the password-file stream |
|
332 endpwent -- close the password-file stream |
|
333 |
2484
|
334 * Functions for getting info from the group database on Unix systems: |
|
335 |
|
336 getgrent -- read entry from group-file stream, opening if necessary |
|
337 getgrgid -- search for group entry with matching group ID |
|
338 getgrnam -- search for group entry with matching group name |
|
339 setgrent -- rewind the pgroup-file stream |
|
340 endgrent -- close the group-file stream |
|
341 |
2452
|
342 * The New function octave_config_info returns a structure containing |
|
343 information about how Octave was configured and compiled. |
|
344 |
|
345 * New function getrusage returns a structure containing system |
|
346 resource usage statistics. The `cputime' function is now defined |
|
347 in an M-file using getrusage. |
|
348 |
|
349 * The info reader is now a separate binary that runs as a |
|
350 subprocess. You still need the info reader distributed with |
|
351 Octave though, because there are some new command-line arguments |
|
352 that are not yet available in the public release of Info. |
|
353 |
|
354 * There is a new built-in variable, INFO_PROGRAM, which is used as |
|
355 the name of the info program to run. Its initial value is |
|
356 $OCTAVE_HOME/lib/octave/VERSION/exec/ARCH/info, but that value can |
|
357 be overridden by the environment variable OCTAVE_INFO_PROGRAM, or |
|
358 the command line argument --info-program NAME, or by setting the |
|
359 value of INFO_PROGRAM in a startup script. |
|
360 |
|
361 * There is a new built-in variable, EXEC_PATH, which is used as |
|
362 the list of directories to search when executing subprograms. Its |
|
363 initial value is taken from the environment variable |
|
364 OCTAVE_EXEC_PATH (if it exists) or PATH, but that value can be |
|
365 overridden by the the command line argument --exec-path PATH, or |
|
366 by setting the value of EXEC_PATH in a startup script. If the |
|
367 EXEC_PATH begins (ends) with a colon, the directories |
|
368 $OCTAVE_HOME/lib/octave/VERSION/exec/ARCH and $OCTAVE_HOME/bin are |
|
369 prepended (appended) to EXEC_PATH (if you don't specify a value |
|
370 for EXEC_PATH explicitly, these special directories are prepended |
|
371 to your PATH). |
|
372 |
|
373 * If it is present, Octave will now use an `ls-R' database file to |
|
374 speed up recursive path searching. Octave looks for a file called |
|
375 ls-R in the directory specified by the environment variable |
|
376 OCTAVE_DB_DIR. If that is not set but the environment variable |
|
377 OCTAVE_HOME is set, Octave looks in $OCTAVE_HOME/lib/octave. |
|
378 Otherwise, Octave looks in the directory $datadir/octave (normally |
|
379 /usr/local/lib/octave). |
|
380 |
|
381 * New examples directory. |
|
382 |
|
383 * There is a new script, mkoctfile, that can be used to create .oct |
|
384 files suitable for dynamic linking. |
|
385 |
|
386 * Many more bug fixes. |
|
387 |
|
388 * ChangeLogs are now kept in each subdirectory. |
|
389 |
|
390 See NEWS.1 for old news. |