I have error codes when which I am unsure how to fix

48 次查看(过去 30 天)
This is the what the command window is saying after I try to run my code:
fminunc requires Optimization Toolbox.
Error in runMe (line 65)
fminunc(@(t)(costFunctionReg(t, X, y, lambda)), initial_theta, options);
Error in run (line 99)
evalin('caller', strcat(script, ';'));
  2 个评论
Dyuman Joshi
Dyuman Joshi 2023-12-19
[status,errmsg] = license('checkout','Optimization_Toolbox')
Run this code and see if you have the Optimization Toolbox licensed or not.
If status is 1, you have it licensed and download and install the toolbox from the Add-ons.
If status is 0, you will need to purchase the toolbox.

请先登录,再进行评论。

回答(1 个)

arushi
arushi 2024-9-2
Hi Danny,
It seems that you are encountering the above error code because of the absence of the 'Optimization ToolBox'. You can verify if you have the license for the same or not by using the following command:
a = license('test','Optimization_Toolbox')
% a = 1 denotes that you have the license of the toolbox therefore you have to
% install it from the Add-ons.
% a = 0 denotes the absence of license of the toolbox therefore you have to purchase it
% for the Optimization_Toolbox
You can also verify if the toolbox is installed or not by using the following command:
v = ver;
a = any(strcmp('Optimization Toolbox', {v.Name}))
% a = 1 denotes that the toolbox is installed but since it is showing the error therefore
% you should try reinstalling it from the Add-ons.
% a = 0 denotes that the toolbox is not installed therefore you should
% install it from the Add-ons.
I hope it helps!

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by