フィルターのクリア

this is my code i am getting error with x = simulannea​lbnd(Objec​tiveFuncti​on,X0,ydat​a,lb,ub). can help me to resolve it

1 回表示 (過去 30 日間)
function y = parameterized_objective(x,xdata)
y =x(1)./((x(2).*(xdata.^(1+0.9)))+x(3).*(xdata.^(0.9))+1);
ydata=(0.2575./((xdata.^2)+(0.333.*xdata)+1));
xdata =[ 10.^(-5) 10.^(-4) 10.^(-3) 10.^(-2) 10.^(-1) 1] ;
ObjectiveFunction = @(x)parameterized_objective(x,xdata);
X0 = [0; 0; 0 ];
lb = [0.2; 0.2; 0.2];
ub = [1; 1; 1];
x = simulannealbnd(ObjectiveFunction,X0,ydata,lb,ub)

採用された回答

Walter Roberson
Walter Roberson 2017 年 8 月 5 日
The simulannealbnd function does not expect ydata to be passed to it. You might need
ObjectiveFunction = @(x)parameterized_objective(x,xdata,ydata);
x = simulannealbnd(ObjectiveFunction,X0,lb,ub)
having changed parameterized_objective to expect ydata
  5 件のコメント
Walter Roberson
Walter Roberson 2017 年 8 月 6 日
Your code
function y = parameterized_objective(x,xdata)
y =x(1)./((x(2).*(xdata.^(1+0.9)))+x(3).*(xdata.^(0.9))+1);
does not appear to have a need for ydata. Why was it that you were passing ydata to simulannealbnd ? Were you trying to do a fitting? If so then you should be using
xdata =[ 10.^(-5) 10.^(-4) 10.^(-3) 10.^(-2) 10.^(-1) 1] ;
ydata=(0.2575./((xdata.^2)+(0.333.*xdata)+1));
parameterized_objective = @(x,xdata) x(1)./((x(2).*(xdata.^(1+0.9))) + x(3).*(xdata.^(0.9))+1);
ObjectiveFunction = @(x) sum((parameterized_objective(x,xdata) - ydata).^2);
X0 = [0; 0; 0 ];
lb = [0.2; 0.2; 0.2];
ub = [1; 1; 1];
x = simulannealbnd(ObjectiveFunction, X0, lb, ub)
ash
ash 2017 年 8 月 7 日
Now my code is working..Thanks a lot...

サインインしてコメントする。

その他の回答 (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