Error using internal.stats.parseArgs (line 42) Unable to resolve the name statslib.i​nternal.pa​rseArgs. Error in optimizableVariable (line 92) [Type, Transfor

27 次查看(过去 30 天)
function this = optimizableVariable(Name, Range, varargin)
if nargin > 0
% Convert String inputs to char/cellstr
Name = convertStringsToChars(Name);
Range = convertStringsToChars(Range);
[varargin{:}] = convertStringsToChars(varargin{:});
this.PrivName = Name;
this.PrivRange = Range;
ArgNames = {'Type', 'Transform', 'Optimize'};
Defaults = {'real', 'none', true};
[Type, Transform, Optimize, SetFlags] = internal.stats.parseArgs(...
ArgNames, Defaults, varargin{:});
this.TypeSet = SetFlags.Type;
this.PrivType = Type;
this.PrivTransform = Transform;
this.PrivOptimize = Optimize;
this = checkAndFill(this);
end
end

回答(1 个)

Abhishek Chakram
Abhishek Chakram 2023-12-20
Hi ke yi,
It is my understanding that you are facing difficulty in resolving the error in your code. The error message indicates that MATLAB is unable to resolve the name `statslib.internal.parseArgs`. This could be due to several reasons such as the Statistics and Machine Learning Toolbox not being installed, a licensing issue or a missing file in the installation.
Here are few steps to troubleshoot the same:
1. Ensure that the Statistics and Machine Learning Toolbox is installed by running the “ver” command. This will list all the installed toolboxes. Look for "Statistics and Machine Learning Toolbox" in the list.
2. Make sure that you have a valid license for the Statistics and Machine Learning Toolbox by running the following command:
license('test', 'Statistics_Toolbox')
%If this returns 0, it means you do not have a valid license for the toolbox.
3. Uninstall and reinstall the Statistics and Machine Learning Toolbox again to cater the possibility of a missing file in the installation
You can refer to the following documentation to know more about the functions used:
Best Regards,
Abhishek Chakram

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by