Parameter adjust for complex functions
3 ビュー (過去 30 日間)
古いコメントを表示
Dear all,
I've got a function with four parameters that i want to adjust in order to get the minimum possible error. Like the following:
function[error]=FUN(f1,f2,f3,f4) %Being f1, f2, f3 & f4 the parameters and [error] the number to minimize
end
This function is quite complex and I can't use it with fminsearch (i can't write it as function handle), so I wanted to ask if there is any other function that can run it several times, modifying f1,f2,f3 & f4 in order to find a local minimun. I couldn't find anything in the MATLAB help that would do this.
Sorry if I got any grammar/spelling errors, my english is a bit rusty :)
Best regards,
Tomás
0 件のコメント
採用された回答
Torsten
2022 年 9 月 16 日
fminsearch also works with functions, not only function handles.
fun = @(f)FUN(f(1),f(2),f(3),f(4));
f10 = ...;
f20 = ...;
f30 = ...;
f40 = ...;
f0 = [f10,f20,f30,f40];
f = fminsearch(fun,f0);
f1 = f(1)
f2 = f(2)
f3 = f(3)
f4 = f(4)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Optimization Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!