fminsearch error 'Argument 3 must be an options structure'

22 visualizzazioni (ultimi 30 giorni)
Greatings to all respected Matlab commuity!
I am working on adsorption isotherm modeling.
When I execute this command to find optimal values I obtained an erro
[a_optimal,options] = fminsearch('residual',a,options,[],f,p,cmu);
'Argument 3 must be an options structure'. If focus on the options is placed as third argument.
Can any please help me regarding this
f = is the function
p, cmu = Arguments to be passed to f.
a = is an array of initial guess comprising of 3 varables uses in the f
a = [0.2, 1, 0.9]
start_time = cputime;
options(2) = tol; % TERMINATION TOLERANCE FOR A
options(3) = tol; % TERMINAL TOLERANCE FOR THE FUNCTION RESIDUAL
options(14) = max; % MAXIMUM NUMBER OF ITERATIONS
[a_optimal,options] = fminsearch('residual',a,options,[],f,p,cmu);

Risposta accettata

Bruno Luong
Bruno Luong il 23 Apr 2022
You need to create options using optimset function
  5 Commenti
Bruno Luong
Bruno Luong il 23 Apr 2022
" Can you please check how can I implement the optimset in this code. "
I don't want to. @Hafiz Muhammad Asfahan Please don't dump the code with a lot of irrelevant information.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by