fminsearch error 'Argument 3 must be an options structure'

25 views (last 30 days)
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);

Accepted Answer

Bruno Luong
Bruno Luong on 23 Apr 2022
You need to create options using optimset function
  5 Comments
Bruno Luong
Bruno Luong on 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.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!