User defined optimization solver options

조회 수: 3 (최근 30일)
Umberto
Umberto 2015년 8월 4일
답변: Alan Weiss 2015년 8월 5일
I have defined my own optimization solver, and I was trying to set the options using optimset. I tried to change the Algorithm field, but it doesn't let me change it to other algorithms apart from the allowed ones.
So I used a structure instead defined by me. The problem is that with a structure I cannot use optimget(options, FieldName, default) to extract the value of the field of interest and put a default if the Field doesn't exist in the options structure. How can I do this? Especially the default part is really important to me. Also, how can I deal with case sensitivity? If someone writes 'algorithm' instead of 'Algorithm' how can I extract the value anyway?
Thanks a lot

채택된 답변

Alan Weiss
Alan Weiss 2015년 8월 5일
This isn't really an optimization question, but a programming question. I am not an expert programmer. But I'll tell you wat I think anyway.
As part of your solver, you can create a structure of default option values. Then read in values from a user-supplied option structure to override the default values.
For case sensitivity, you can use the lower function with all strings to make everything case-insensitive.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by