I have error codes when which I am unsure how to fix
31 次查看(过去 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
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
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!
0 个评论
另请参阅
类别
在 Help Center 和 File 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!