User defined optimization solver options

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 日

0 投票

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 件)

カテゴリ

製品

質問済み:

2015 年 8 月 4 日

回答済み:

2015 年 8 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by