User defined optimization solver options

2 ビュー (過去 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 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by