Optimization Toolbox - Use of 'interior-point'

I have the following code:
options = optimoptions(@fmincon,'Algorithm','interior-point');
f = @(x)CA_OptP(x,DistancesKM, StudentsByTown, A_Students);
[x, fval, output] = fmincon(f,x0,[],[],[],[],0,10, nonlcon, options);
[P_Students, Weights] = CA1(x,param1, param 2)
I get this error message: Undefined function 'optimoptions' for input arguments of type 'function_handle'.
What did I do wrong with specifying options?

댓글 수: 1

Matt J
Matt J 2013년 4월 15일
You should learn to format your code using the "{} Code" formatting icon, as I have now done for you.

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt J
Matt J 2013년 4월 15일

1 개 추천

Are you sure you don't mean
options = optimset('Algorithm','interior-point');
Otherwise, where did you encounter the "optimoptions" command?

추가 답변 (2개)

Sean de Wolski
Sean de Wolski 2013년 4월 15일
편집: Sean de Wolski 2013년 4월 15일

1 개 추천

Hi Christoph and Matt J,
optimoptions is a new class in R2013a meant to be used in place of optimset. If you are not using R2013a it will not be available.
If you are using R2013a and getting that error message, there are a few possible causes:
  • You do not have a license for the Optimization Toolbox. You could test this by running the following and see if it is followed by "Has no license availabe"
which -all optimoptions
  • The path is corrupted. Run the following:
restoredefaultpath; rehash toolboxcache;savepath
Christoph
Christoph 2013년 4월 15일

0 개 추천

Thx guys for your answers. I'm indeed using 2012 and unfortunately look up the 2013 tutorial. With optimset it worked! thx for the fast feedback

카테고리

도움말 센터File Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

태그

질문:

2013년 4월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by