Octave 'inverse' function different than Matlab's

Just a heads-up:

Octave has the ‘inverse’ function as an alias for ‘inv’. Matlab doesn’t have this alias.
While processing contributed functions in patch #10022 I found that Matlab apparently has claimed the ‘inverse’ function for:

(1) the Laurent matrix inverse (as of r2021b) in the Wavelet toolbox;

(2) various coordinate conversion functions for the Mapping toolbox (as of r2013a). For that use case one first has to create a ‘converter’ (classdef I presume) that can then be called using ‘inverse’ and ‘forward’ functions (see e.g., [Convert authalic, conformal, isometric, or rectifying latitude to geodetic latitude - MATLAB inverse - MathWorks Benelux](https://see here)). An obvious consequence is that, if the user also has the Wavelet toolbox installed, its Laurent matrix inverse gets shadowed by the classdef ‘inverse’ function from the coodrinate converter.
As for this sort of namespace usage my only comment is that Matlab apparently seems to hit some limits of its (lack of a) namespace model, and maybe some day Octave might even need to follow.

I only wanted to bring up that Octave’s ‘inverse’ function alias for ‘inv’ is Matlab-incompatible, and then only if toolboxes (packages) come into play. But IMO it’s worthwile to think about it in time.

In the case of patch #10022 I have no ambitions (yet) to introduce matching classdef-style conversion functions incl. ‘inverse’ and ‘forward’; the contributor supplied “classic” style functions that AFAICS seem to work good enough (and IMO are much simpler and more direct).

1 Like