フィルターのクリア

Help with optimization tool

1 回表示 (過去 30 日間)
Sudarshan
Sudarshan 2012 年 11 月 8 日
Hello,
I am new to MATLAB and I am using Optimization tool in MATLAB for a research project. when i try to optimize the following function
function y = test2()
y=zeros(1:4);
f=funVAMPzero(x);
a=f.a;
y(1)= (a(1));
y(2)=(a(2));
y(3)=(a(3));
y(4)=(a(4));
end
i get an error message saying too many input arguments. I have used f=funVAMPzero(x) to get variable from another m-file whose values i have to optimze.
Inputs on the issue would be very helpful. Thanks in advance!!

採用された回答

Kye Taylor
Kye Taylor 2012 年 11 月 8 日
編集済み: Kye Taylor 2012 年 11 月 8 日
The error is occuring because the optim tool is trying to call test2() with a vector input, but you do not declare a vector input in the function's declaration. The interface to the objective function should look like
function y = test2(x)
where x is a vector of your design variables.
Futhermore, the output of the objective function depends on your problem. What solver are you using? (It's an option specified in the optimtool GUI.) Can you describe your goal (objective function and constraints)in a bit more detail?
  1 件のコメント
Sudarshan
Sudarshan 2012 年 11 月 9 日
Hello Kyle,
Thanks for helping me out. I have another m-file that generates 8 variables for aircraft design and i have to optimize only 4 of them, I am having trouble in importing the 4 variables alone from the other mfile to this one. these 4 variables are my objectives to optimize.I am using the gamultiobj tool.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by