fminsearch error 'Argument 3 must be an options structure'

45 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

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!