How to Call simulannealbnd from a function

2 ビュー (過去 30 日間)
Muhammad Adil Raja
Muhammad Adil Raja 2018 年 10 月 9 日
Hi, I am trying to call simulannealbnd in a function. And I am getting the following error.
Error using simulannealcommon (line 42) You must provide an initial point.
When I call simulannealbnd from the workspace, it works fine. I wonder what is the problem. Here is the code snippet that I am using.
fitfunc=['@(w,X,T)mean(power(T-(' str1 '),2))']; parameterized_objective=str2func(fitfunc); ObjectiveFunction=@(w)parameterized_objective(w, X, T); LB=params.LB; UB=params.UB; W0=rand(1,5); [coefs,cost] = simulannealbnd(ObjectiveFunction,W0);

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulated Annealing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by