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 |
|
187 more -- turn the pager on or off |
|
188 gammaln -- alias for lgamma |
|
189 |
|
190 * New audio functions from Andreas Weingessel |
|
191 <Andreas.Weingessel@ci.tuwien.ac.at>. |
|
192 |
2458
|
193 lin2mu -- linear to mu-law encoding |
|
194 loadaudio -- load an audio file to a vector |
|
195 mu2lin -- mu-law to linear encoding |
|
196 playaudio -- play an audio file |
|
197 record -- record sound and store in vector |
|
198 saveaudio -- save a vector as an audio file |
|
199 setaudio -- executes mixer shell command |
2452
|
200 |
|
201 * New plotting functions from Vinayak Dutt. Ones dealing with |
|
202 multiple plots on one page require features from gnuplot 3.6beta |
|
203 (or later). |
|
204 |
|
205 bottom_title -- put title at the bottom of the plot |
|
206 mplot -- multiplot version of plot |
|
207 multiplot -- switch multiple-plot mode on or off |
|
208 oneplot -- return to one plot per page |
|
209 plot_border -- put a border around plots |
|
210 subplot -- position multiple plots on a single page |
|
211 subwindow -- set subwindow position for next plot |
|
212 top_title -- put title at the top of the plot |
|
213 zlabel -- put a label on the z-axis |
|
214 |
|
215 * New string functions |
|
216 |
|
217 bin2dec -- convert a string of ones and zeros to an integer |
|
218 blanks -- create a string of blanks |
|
219 deblank -- delete trailing blanks |
|
220 dec2bin -- convert an integer to a string of ones and zeros |
|
221 dec2hex -- convert an integer to a hexadecimal string |
|
222 findstr -- locate occurrences of one string in another |
|
223 hex2dec -- convert a hexadecimal string to an integer |
|
224 index -- return position of first occurrence a string in another |
|
225 rindex -- return position of last occurrence a string in another |
|
226 split -- divide one string into pieces separated by another |
|
227 str2mat -- create a string matrix from a list of strings |
|
228 strrep -- replace substrings in a string |
|
229 substr -- extract a substring |
|
230 |
|
231 The following functions return a matrix of ones and zeros. |
|
232 Elements that are nonzero indicate that the condition was true for |
|
233 the corresponding character in the string array. |
|
234 |
|
235 isalnum -- letter or a digit |
|
236 isalpha -- letter |
|
237 isascii -- ascii |
|
238 iscntrl -- control character |
|
239 isdigit -- digit |
|
240 isgraph -- printable (but not space character) |
|
241 islower -- lower case |
|
242 isprint -- printable (including space character) |
|
243 ispunct -- punctuation |
|
244 isspace -- whitespace |
|
245 isupper -- upper case |
|
246 isxdigit -- hexadecimal digit |
|
247 |
|
248 These functions return new strings. |
|
249 |
2458
|
250 tolower -- convert to lower case |
|
251 toupper -- convert to upper case |
2452
|
252 |
|
253 * New function, fgetl. Both fgetl and fgets accept an optional |
|
254 second argument that specifies a maximum number of characters to |
|
255 read, and the function fgets is now compatible with Matlab. |
|
256 |
|
257 * Printing in hexadecimal format now works (format hex). It is also |
|
258 possible to print the internal bit representation of a value |
|
259 (format bit). Note that these formats are only implemented for |
|
260 numeric values. |
|
261 |
|
262 * Additional structure features: |
|
263 |
|
264 -- Name completion now works for structures. |
|
265 |
|
266 -- Values and names of structure elements are now printed by |
|
267 default. The new built-in variable `struct_levels_to_print' |
|
268 controls the depth of nested structures to print. The default |
|
269 value is 2. |
|
270 |
|
271 -- New functions: |
|
272 |
|
273 struct_contains (S, NAME) -- returns 1 if S is a structure with |
|
274 element NAME; otherwise returns 0. |
|
275 |
|
276 struct_elements (S) -- returns the names of all elements |
|
277 of structure S in an array of strings. |
|
278 |
|
279 * New io/subprocess functions: |
|
280 |
2458
|
281 fputs -- write a string to a file with no formatting |
|
282 popen2 -- start a subprocess with 2-way communication |
|
283 mkfifo -- create a FIFO special file |
|
284 popen -- open a pipe to a subprocess |
|
285 pclose -- close a pipe from a subprocess |
|
286 waitpid -- check the status of or wait for subprocesses |
2452
|
287 |
|
288 * New time functions: |
|
289 |
2458
|
290 asctime -- format time structure according to local format |
|
291 ctime -- equivalent to `asctime (localtime (TMSTRUCT))' |
|
292 gmtime -- return time structure corresponding to UTC |
|
293 localtime -- return time structure corresponding to local time zone |
|
294 strftime -- print given time structure using specified format |
|
295 time -- return current time |
2452
|
296 |
|
297 The `clock' and `date' functions are now implemented in M-files |
|
298 using these basic functions. |
|
299 |
|
300 * Access to additional Unix system calls: |
|
301 |
|
302 dup2 -- duplicate a file descriptor |
|
303 exec -- replace current process with a new process |
|
304 fcntl -- control open file descriptors |
|
305 fork -- create a copy of the current process |
|
306 getpgrp -- return the process group id of the current process |
|
307 getpid -- return the process id of the current process |
|
308 getppid -- return the process id of the parent process |
|
309 pipe -- create an interprocess channel |
|
310 |
|
311 * Other new functions: |
|
312 |
2458
|
313 tmpnam -- replaces octave_tmp_file_name |
|
314 atexit -- register functions to be called when Octave exits |
|
315 putenv -- define an environment variable |
|
316 meshgrid -- compatible with Matlab's meshgrid function |
|
317 tilde_expand -- perform tilde expansion on string |
|
318 completion_matches -- perform command completion on string |
2452
|
319 |
2459
|
320 * Functions for getting info from the password database on Unix systems: |
|
321 |
|
322 getpwent -- read entry from password-file stream, opening if necessary |
|
323 getpwuid -- search for password entry with matching user ID |
|
324 getpwnam -- search for password entry with matching username |
|
325 setpwent -- rewind the password-file stream |
|
326 endpwent -- close the password-file stream |
|
327 |
2452
|
328 * The New function octave_config_info returns a structure containing |
|
329 information about how Octave was configured and compiled. |
|
330 |
|
331 * New function getrusage returns a structure containing system |
|
332 resource usage statistics. The `cputime' function is now defined |
|
333 in an M-file using getrusage. |
|
334 |
|
335 * The info reader is now a separate binary that runs as a |
|
336 subprocess. You still need the info reader distributed with |
|
337 Octave though, because there are some new command-line arguments |
|
338 that are not yet available in the public release of Info. |
|
339 |
|
340 * There is a new built-in variable, INFO_PROGRAM, which is used as |
|
341 the name of the info program to run. Its initial value is |
|
342 $OCTAVE_HOME/lib/octave/VERSION/exec/ARCH/info, but that value can |
|
343 be overridden by the environment variable OCTAVE_INFO_PROGRAM, or |
|
344 the command line argument --info-program NAME, or by setting the |
|
345 value of INFO_PROGRAM in a startup script. |
|
346 |
|
347 * There is a new built-in variable, EXEC_PATH, which is used as |
|
348 the list of directories to search when executing subprograms. Its |
|
349 initial value is taken from the environment variable |
|
350 OCTAVE_EXEC_PATH (if it exists) or PATH, but that value can be |
|
351 overridden by the the command line argument --exec-path PATH, or |
|
352 by setting the value of EXEC_PATH in a startup script. If the |
|
353 EXEC_PATH begins (ends) with a colon, the directories |
|
354 $OCTAVE_HOME/lib/octave/VERSION/exec/ARCH and $OCTAVE_HOME/bin are |
|
355 prepended (appended) to EXEC_PATH (if you don't specify a value |
|
356 for EXEC_PATH explicitly, these special directories are prepended |
|
357 to your PATH). |
|
358 |
|
359 * If it is present, Octave will now use an `ls-R' database file to |
|
360 speed up recursive path searching. Octave looks for a file called |
|
361 ls-R in the directory specified by the environment variable |
|
362 OCTAVE_DB_DIR. If that is not set but the environment variable |
|
363 OCTAVE_HOME is set, Octave looks in $OCTAVE_HOME/lib/octave. |
|
364 Otherwise, Octave looks in the directory $datadir/octave (normally |
|
365 /usr/local/lib/octave). |
|
366 |
|
367 * New examples directory. |
|
368 |
|
369 * There is a new script, mkoctfile, that can be used to create .oct |
|
370 files suitable for dynamic linking. |
|
371 |
|
372 * Many more bug fixes. |
|
373 |
|
374 * ChangeLogs are now kept in each subdirectory. |
|
375 |
|
376 See NEWS.1 for old news. |