Azzera filtri
Azzera filtri

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

42 visualizzazioni (ultimi 30 giorni)
Danny
Danny il 19 Dic 2023
Risposto: arushi il 2 Set 2024
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 Commenti
Mario Malic
Mario Malic il 19 Dic 2023
You need to install the mentioned toolbox.
Dyuman Joshi
Dyuman Joshi il 19 Dic 2023
[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.

Accedi per commentare.

Risposte (1)

arushi
arushi il 2 Set 2024
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!

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by