fminsearchbnd optimization function in matlab

37 Ansichten (letzte 30 Tage)
mohammed hussein
mohammed hussein am 2 Dez. 2015
Beantwortet: MASTER WHOS am 8 Feb. 2019
i used fminsearchbnd for boundary problem but the matlab it tell me that Undefined function 'fminsearchbnd' can any one help me with is problem i used this example
fun = @(x)(x(1)-5)^2+(x(2)+6)^2+x(3); % x0 = [0 0 0]; Lb=[0 -1 2]; Ub=[1 2 3]; [x,fval,exitflag,output] = fminsearchbnd(fun,Lb,Ub); disp(fval)
thank you

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Dez. 2015
fminsearchbnd is not part of MATLAB. You can get it one of the versions from the File Exchange
  3 Kommentare
Walter Roberson
Walter Roberson am 2 Dez. 2015
Do not put it in the MATLAB toolbox. Download the .zip file, and unzip it into a directory that has nothing else in it (and which is not under the MATLAB installation.) Then use pathtool to add the directory to the MATLAB path. After that MATLAB will be able to find the file.
mohammed hussein
mohammed hussein am 2 Dez. 2015
Thank you very much

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (3)

MASTER WHOS
MASTER WHOS am 7 Feb. 2019
I DID THIS:
Do not put it in the MATLAB toolbox. Download the .zip file, and unzip it into a directory that has nothing else in it (and which is not under the MATLAB installation.) Then use pathtool to add the directory to the MATLAB path. After that MATLAB will be able to find the file.
but it gives error: Error in fminsearchbnd (line 264)
[xu,fval,exitflag,output] = fminsearch(intrafun,x0u,options,varargin);
what might be the problem?
  11 Kommentare
Torsten
Torsten am 8 Feb. 2019
I still don't see neither
@SQP_complex2
nor
@SQP_complex2_case2
Walter Roberson
Walter Roberson am 8 Feb. 2019
I have my own private implementation of tricking fminsearch into being bounded (stops when it hits the boundary rather than reflecting as might be nice.)
I know from experience that 55 variables is completely intractable to use seriously with fminsearch . fminsearch gets caught in local minima , not as easily as fmincon gets caught but it happens all the time. It is not a global minimizer. To use it for more than light use you need to start it at multiple locations . In particular you need starting points near every valid combination of upper and lower bounds . With 55 variables that would be 2^55 configuration to examine. If you could process 2^30 per second (gigaflop range ) then that would take you 2^25 seconds . That would be a year . You probably cannot process more than 1/100 of that speed so probably 100 or so years . Just for figuring out crudely which end of each bound you probably near.

Melden Sie sich an, um zu kommentieren.


MASTER WHOS
MASTER WHOS am 8 Feb. 2019
Thanks for your comment.
sorry, so, is that the only problem? [missing @SQP_complex2, & @SQP_complex2_case2] (which bring the error I attached with fminsearchbnd)?
  2 Kommentare
Torsten
Torsten am 8 Feb. 2019
Bearbeitet: Torsten am 8 Feb. 2019
I don't know, but if you don't supply a functional expression to be minimized, "fminsearchbnd" will of course complain.
Walter Roberson
Walter Roberson am 8 Feb. 2019
There is @ missing before SQP_complex_case2 unless that is a function that returns aa function handle.

Melden Sie sich an, um zu kommentieren.


MASTER WHOS
MASTER WHOS am 8 Feb. 2019
Ok, thank you

Kategorien

Mehr zu Downloads finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by