Skip to content
Snippets Groups Projects
Commit 933ed45e authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Octave 4.4 no longer includes statistics functions

Those have been moved to the statistics package. If that package is not there,
use a fallback.
parent 7cbac0c9
No related branches found
No related tags found
No related merge requests found
...@@ -77,16 +77,11 @@ p = {'/distributions/' ; ... ...@@ -77,16 +77,11 @@ p = {'/distributions/' ; ...
% For functions that exist only under some Octave versions % For functions that exist only under some Octave versions
% or some MATLAB versions, and for which we provide some replacement functions % or some MATLAB versions, and for which we provide some replacement functions
% Replacements for rows(), columns(), vec() and issquare() (inexistent under MATLAB)
if ~isoctave if ~isoctave
% Replacements for rows(), columns() and issquare() (inexistent under MATLAB)
p{end+1} = '/missing/rows_columns'; p{end+1} = '/missing/rows_columns';
p{end+1} = '/missing/issquare'; p{end+1} = '/missing/issquare';
% Replacement for vec() (inexistent under MATLAB)
p{end+1} = '/missing/vec'; p{end+1} = '/missing/vec';
if ~user_has_matlab_license('statistics_toolbox')
% Replacements for functions of the stats toolbox
p{end+1} = '/missing/stats/';
end
end end
% ordeig() doesn't exist in Octave % ordeig() doesn't exist in Octave
...@@ -106,6 +101,13 @@ if (isoctave && ~user_has_octave_forge_package('statistics')) ... ...@@ -106,6 +101,13 @@ if (isoctave && ~user_has_octave_forge_package('statistics')) ...
p{end+1} = '/missing/nanmean'; p{end+1} = '/missing/nanmean';
end end
% Replacements for functions of the MATLAB statistics toolbox
% These functions were part of Octave < 4.4, they are now in the statistics Forge package
if (isoctave && ~octave_ver_less_than('4.4') && ~user_has_octave_forge_package('statistics')) ...
|| (~isoctave && ~user_has_matlab_license('statistics_toolbox'))
p{end+1} = '/missing/stats/';
end
% Check if struct2array is available. % Check if struct2array is available.
if ~exist('struct2array') if ~exist('struct2array')
p{end+1} = '/missing/struct2array'; p{end+1} = '/missing/struct2array';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment