comparison pages/NEWS.7.md @ 276:12bb9bb7602f

Octave 7.1.0 release 2022-04-06
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Fri, 08 Apr 2022 22:23:16 +0900
parents
children
comparison
equal deleted inserted replaced
275:2657bda7f035 276:12bb9bb7602f
1 ---
2 layout: page
3 title: GNU Octave Version 7
4 permalink: NEWS-7.html
5 ---
6
7 ## Summary of important user-visible changes
8
9 April 06, 2022
10
11 {% include release_news_select.md %}
12
13 {::options parse_block_html="true" /}
14 <div class="panel callout">
15 * TOC
16 {:toc}
17 </div>
18 {::options parse_block_html="false" /}
19
20
21 ### General improvements
22
23 - Many functions in Octave can be called in a command form---no
24 parentheses for invocation and no return argument assignment---or in a
25 functional form---parentheses and '=' for assignment of return values.
26
27 **Command Form Example**
28
29 `mkdir new_directory`
30
31 **Function Form Example**
32
33 `status = mkdir ("new_directory")`
34
35 Octave now handles errors that occur in a consistent manner. If
36 called in command form and there is a failure, an error is thrown
37 and a message printed. If called in functional form, no error or
38 message is printed and the failure is communicated to the programmer
39 via the output status variable.
40
41 The following list of functions have been modified.
42
43 * `copyfile`
44 * `fcntl`
45 * `fileattrib`
46 * `kill`
47 * `link`
48 * `mkfifo`
49 * `movefile`
50 * `rename`
51 * `rmdir`
52 * `symlink`
53 * `unlink`
54
55 - Calling a user-defined function with too many inputs or outputs is now
56 an error. The interpreter makes this check automatically. If a
57 function uses `varargin` then the check is skipped for function inputs,
58 and if a function uses `varargout` then the check is skipped for function
59 outputs. Input validation for functions typically begins with checking
60 that the number of inputs and outputs match expectations. Existing code
61 can be simplified by removing these checks which are now done by the
62 interpreter. Typically, code blocks like the following can simply be
63 deleted.
64
65 ## Checking number of inputs
66 if (nargin > 2)
67 print_usage ();
68 endif
69
70 ## Checking number of outputs
71 if (nargout > 1)
72 print_usage ();
73 endif
74
75 - Binary and hexadecimal constants like `0b101` and `0xDEADBEEF` now
76 create integers (unsigned by default) with sizes determined from the
77 number of digits present. For example, `0xff` creates a `uint8` value
78 and `0xDEADBEEF` creates a `uint64` value. You may also use a suffix of
79 the form `u8`, `u16`, `u32`, `u64`, `s8`, `s16`, `s32`, or `s64` to
80 explicitly specify the data type to use (`u` or `s` to indicate unsigned
81 or signed and the number to indicate the integer size).
82
83 Binary constants are limited to 64 binary digits and hexadecimal
84 constants are limited to 16 hexadecimal digits with no automatic
85 rounding or conversion to floating point values. Note that this may
86 cause problems in existing code. For example, an expression like
87 `[0x1; 0x100; 0x10000]` will be uint8 (because of the rules of
88 concatenating integers of different sizes) with the larger values
89 truncated (because of the saturation semantics of integer values). To
90 avoid these kinds of problems either: 1) declare the first integer to be
91 of the desired size such as `[0x1u32; 0x100; 0x10000]`, or 2) pad
92 constants in array expressions with leading zeros so that they use the
93 same number of digits for each value such as
94 `[0x00_00_01; 0x00_01_00; 0x01_00_00]`.
95
96 - The colon operator now works for integer (int8, int16, ..., uint64)
97 and single data types. However, only double ranges use a
98 memory-efficient storage scheme internally. Other data types are
99 stored as ordinary arrays.
100
101 - The increment and decrement operators `++` and `--` must "hug" their
102 corresponding variables. In previous versions of Octave, whitespaces
103 between these operators and the variable they affect were allowed. That
104 is no longer the case.
105
106 - The `mldivide` function (i.e., the `\` operator) now uses an LU
107 decomposition to solve nearly singular full square matrices. This is
108 Matlab-compatible and yields results which more nearly minimize `norm
109 (A*x - b)`. Previously, Octave computed a minimum-norm solution.
110
111 - The `factor` function has been overhauled for speed. For large
112 inputs > 1e14, it can be up to 10,000 times faster.
113
114 - The `isprime` function uses a new primality testing algorithm
115 that is up to 50,000 times faster for inputs > 1e14.
116
117 - The `betainc` function now calculates an exact output for the
118 important special cases where a or b are 1.
119
120 - The `whos` function now displays an additional attribute 's' when
121 the variable is a sparse type.
122
123 - As part of GSoC 2020, Abdallah K. Elshamy implemented the
124 `jsondecode` and `jsonencode` functions to read and write JSON data.
125
126 - As part of GSoC 2021, Abdallah K. Elshamy implemented the
127 `jupyter_notebook` classdef class. This class supports running and
128 filling Jupyter Notebooks using the Octave language kernel from Octave
129 itself. Making the evaluation of long-running Jupyter Notebooks on a
130 computing server without permanent browser connection possible.
131
132 - By default, the history file is now located at `$DATA/octave/history`,
133 where `$DATA` is a platform dependent location for (roaming) user data
134 files (e.g., `${XDG_DATA_HOME}` or, if that is not set, `~/.local/share` on
135 Unix-like operating systems or `%APPDATA%` on Windows).
136
137 - For Octave on Windows OS, the minimum required version of the Windows
138 API is now 6.1 (Windows 7 or newer).
139
140 - The non-re-entrant version of the QHull library "libqhull" was
141 deprecated upstream. Octave now (optionally) requires the re-entrant
142 version of that library "libqhull_r" instead.
143
144 - Octave's build system no longer appends "++" to the end of the
145 "magick++" library name (set with the `--with-magick=` configure flag).
146 The real name of the "magick++" library (including any potentially
147 trailing "++") needs to be set in that option now.
148
149 - The `pkg update` command now accepts options that are passed to `pkg install` for each updated package. Specifying `-local` or
150 `-global` will restrict update checks to local or global
151 installed packages, respectively.
152
153 ### Graphical User Interface
154
155 - The graphical user interface is now available in Hungarian and
156 Turkish.
157
158 - In debug mode, symbol values are now shown in tooltips when hovering
159 variables in the editor panel.
160
161 - The "Disable global shortcuts when Command Window has focus" GUI
162 preference under the Shortcuts tab is now disabled by default. This
163 option disables keyboard shortcuts to avoid interference with readline
164 key strokes in the Command Window. Unlike versions prior to Octave 7,
165 this preference now also affects the Ctrl-C/V shortcuts for copy/paste.
166
167 - In command line mode, i.e. when Octave is started without the `--gui` option,
168 the doc command now opens the GUI documentation browser as a standalone widget,
169 provided that Octave was compiled with GUI support.
170
171 ### Graphics backend
172
173 - Support for Qt4 for both graphics and the GUI has been removed.
174
175 - If a working LaTeX tool chain is found on the path, including `latex`,
176 `dvipng`, and `dvisvgm` binaries, then text strings can now be rendered
177 properly when using the `"latex"` value for the text objects'
178 `"interpreter"` property and axes objects' `"ticklabelinterpreter"`.
179 Type `doc "latex interpreter"` for further info.
180
181 - The `"Marker"` property for plot objects now accepts `|` which draws
182 a vertical line or `_` which draws a horizontal line.
183
184 - The `FMT` format argument for plot commands now accepts long forms for
185 color names which may be more understandable than the existing
186 one-letter codes. For example, the RGB value `[0 0 0]` can now be
187 specified by `"black"` in addition to `"k"`.
188
189 - The color graphics properties, for example `"EdgeColor"` or
190 `"FaceColor"`, now accept HTML specifications. An HTML specification is
191 a string that begins with the character '#' and is followed by either 3
192 or 6 hexadecimal digits. For example, magenta which is 100% red and
193 blue values can specified by `"#FF00FF"` or `"#F0F"`.
194
195 - The additional property `"contextmenu"` has been added to all graphics
196 objects. It is equivalent to the previously used `"uicontextmenu"`
197 property which is hidden now.
198
199 - `uicontrol` objects now fully implement the `"Off"` and `"Inactive"`
200 values of the `"Enable"` property. When the value is `"Off"`, no
201 interaction with the object occurs and the `uicontrol` changes color
202 (typically to gray) to indicate it is disabled. When the value is
203 `"Inactive"`, the object appears normally (no change in color), but it
204 is not possible to change the value of the object (such as modifying
205 text in an `Edit` box or clicking on a `RadioButton`).
206
207 - The `"ListBoxTop"` property for `uicontrol` objects has been
208 implemented for `set` commands.
209
210 - The `Title` property for print formats such as PDF or SVG is now set
211 to the title displayed on the figure window which contains the plot.
212
213 - Additional properties have been added to the `axes` graphics object:
214 * `"alphamap"` (not yet implemented)
215 * `"alphascale"` (not yet implemented)
216 * `"colorscale"` (not yet implemented)
217 * `"fontsizemode"` (not yet implemented)
218 * `"innerposition"` (equivalent to `"position"`)
219 * `"interactions"` (not yet implemented)
220 * `"layout"` (not yet implemented)
221 * `"legend"` (not yet implemented)
222 * `"nextseriesindex"` (read-only, used by `scatter`
223 graphics objects)
224 * `"positionconstraint"` (replacement for `"activepositionproperty"`
225 which is now a hidden property. No plans for removal.)
226 * `"toolbar"` (not yet implemented)
227 * `"xaxis"` (not yet implemented)
228 * `"yaxis"` (not yet implemented)
229 * `"zaxis"` (not yet implemented)
230
231 ### Matlab compatibility
232
233 - The function `griddata` now implements the `"v4"` Biharmonic Spline
234 Interpolation method. In adddition, the function now accepts 3-D inputs
235 by passing the data to `griddata3`.
236
237 - Coordinate transformation functions `cart2sph`, `sph2cart`,
238 `cart2pol`, and `pol2cart` now accept either row or column vectors for
239 coordinate inputs. A single coordinate matrix with one variable per
240 column can still be used as function input, but a single output variable
241 will now contain just the first output coordinate, and will no longer
242 return the full output coordinate matrix. Output size matches the size
243 of input vectors, or in the case of an input matrix will be column
244 vectors with rows corresponding to the input coordinate matrix.
245
246 - The function `dec2bin` and `dec2hex` now support negative numbers.
247
248 - The function `factor` now supports uint64 inputs larger than
249 `flintmax`.
250
251 - The function `primes` now supports char inputs.
252
253 - The functions `quantile` and `prctile` now permit operating on
254 dimensions greater than `ndims (x)`.
255
256 - The function `iqr` now uses Matlab compatible interpolation for
257 quantile values. The dimension input now allows a vector, "all", and
258 dimensions greater than `ndims (x)`. The function also handles
259 `Inf` and `NaN` input values in a Matlab-compatible manner.
260
261 - The function `importdata` now produces more compatible results when
262 the file contains a 2-D text matrix.
263
264 - The file functions `copyfile`, `mkdir`, `movefile`, `rmdir` now return
265 a logical value (true/false) rather than a numeric value (1/0).
266
267 - `uimenu` now accepts property `"Text"` which is identical to
268 `"Label"`. Matlab recommends using `"Text"` in new code, although there
269 is no announced date for deprecating `"Label"`.
270
271 - The functions `scatter` and `scatter3` now return a handle to a
272 scatter graphics object. For compatibility, they return an `hggroup` of
273 patch graphics objects when the `"gnuplot"` graphics toolkit is used. In
274 previous versions of Octave, these functions returned an `hggroup` of
275 patch graphics objects for all graphics toolkits.
276
277 - The functions `bar` and `barh` now handle stacked negative bar values
278 in a Matlab-compatible manner. Negative values now stack below the zero
279 axis independently of a positive value bars in the same stack.
280 Previously the negative bars could overlap positive bars depending on
281 drawing order.
282
283 - The functions `bar` and `barh` now use colors from the `"ColorOrder"`
284 axes property rather than the `"Colormap"` figure property unless one
285 of the histogram options (@qcode{"hist"}, @qcode{"histc"} was specified.
286
287 - The function `saveas` now defaults to saving in Octave figure format
288 (.ofig) rather than PDF (.pdf).
289
290 - A new warning ID (`"Octave:unimplemented-matlab-functionality"`) has
291 been added which prints a warning when Octave's parser recognizes valid
292 Matlab code, but for which Octave does not yet implement the
293 functionality. By default, this warning is enabled.
294
295 - When Octave is started with the `--traditional` option for maximum
296 compatibility the `print_struct_array_contents` internal variable is set
297 to true.
298
299 - The function `repelem` now produces a row vector output when the input is
300 a scalar.
301
302 - The functions `var` and `std` now accept a weight vector as input and
303 compute the weigthed variance. Dimension input now allows a vector and
304 the keyword "all".
305
306
307 ### Deprecated functions and operators
308
309 The following functions and operators have been deprecated in Octave 7
310 and will be removed from Octave 9 (or whatever version is the second
311 major release after 7):
312
313 - Functions
314
315 Function | Replacement
316 ---------------------------- |----------------------------
317 `disable_diagonal_matrix` | `optimize_diagonal_matrix`
318 `disable_permutation_matrix` | `optimize_permutation_matrix`
319 `disable_range` | `optimize_range`
320
321 - Operators
322
323 Operator | Replacement | Description
324 ---------|-------------|------------
325 `**` | `^` | Matrix exponent
326 `.**` | `.^` | Element-by-element exponent
327 `.+` | `+` | Element-by-element addition
328 `.-` | `-` | Element-by-element subtraction
329
330 - Interpreter
331
332 * The use of `'...'` for line continuations *inside* double-quoted
333 strings has been deprecated. Use `'\'` for line continuations
334 inside strings instead.
335
336 * The use of `'\'` as a line continuation *outside* of double-quoted
337 strings has been deprecated. Use `'...'` for line continuations
338 instead.
339
340 * Any trailing whitespace after a `'\'` line continuation has been
341 deprecated. Delete unnecessary trailing whitespace.
342
343
344 The following functions were deprecated in Octave 6 and will be removed
345 from Octave 8 (or whatever version is the second major release after 6):
346
347 - Functions
348
349 Function | Replacement
350 -----------------------|------------------
351 `runtests` | `oruntests`
352
353 - The environment variable used by `mkoctfile` for linker flags is now
354 `LDFLAGS` rather than `LFLAGS`. `LFLAGS` was deprecated in Octave 6,
355 and a warning is now emitted if it is used, but it will continue to
356 work.
357
358
359 ### Removed functions, properties, and features
360
361 The following functions and properties were deprecated in Octave 5
362 and have been removed from Octave 7.
363
364 - Functions
365
366 Function | Replacement
367 -------------------------|------------------
368 `output_max_field_width` | `output_precision`
369 `is_keyword` | `iskeyword`
370
371 - Properties
372
373 Object | Property | Value
374 -----------------|---------------|------------
375 `text` | `fontangle` | `"oblique"`
376 `uibuttongroup` | `fontangle` | `"oblique"`
377 `uicontrol` | `fontangle` | `"oblique"`
378 `uipanel` | `fontangle` | `"oblique"`
379 `uitable` | `fontangle` | `"oblique"`
380
381 - The prototype JIT compiler has been removed from Octave. Since it was
382 first added as part of a Google Summer of Code project in 2012, no one
383 has ever seriously taken on further development of it and it still does
384 nothing significant. It is out of date with the default interpreter
385 that walks the parse tree. Even though we have fixed the configure
386 script to disable it by default, people still ask questions about how to
387 build it, but it doesn’t seem that they are doing that to work on it but
388 because they think it will make Octave code run faster (it never did,
389 except for some extremely simple bits of code as examples for
390 demonstration purposes only). The following functions related to the
391 JIT compiler have also been removed: `debug_jit`, `jit_enable`,
392 `jit_failcnt`, and `jit_startcnt`.
393
394 ### Alphabetical list of new functions added in Octave 7
395
396 * `cospi`
397 * `getpixelposition`
398 * `endsWith`
399 * `fill3`
400 * `jsondecode`
401 * `jsonencode`
402 * `jupyter_notebook`
403 * `listfonts`
404 * `matlab.net.base64decode`
405 * `matlab.net.base64encode`
406 * `memory`
407 * `ordqz`
408 * `rng`
409 * `sinpi`
410 * `startsWith`
411 * `streamribbon`
412 * `turbo`
413 * `uniquetol`
414 * `xtickangle`
415 * `ytickangle`
416 * `ztickangle`
417