need help with optimtool

6 ビュー (過去 30 日間)
kintali narendra
kintali narendra 2012 年 6 月 8 日
while using fmincon solver in optimtool.......i got problem...in the window i got a message as
Optimization running.
Undefined function or method 'obj.m' for input arguments of type 'double'.
please suggest me what to do?

採用された回答

Sargondjani
Sargondjani 2012 年 6 月 8 日
although this does not matter much, you should add an 'end'
how do you call obj.m with fmincon? and where did you store obj.m??? if you call obj(x0) in the line before your fmincon, does it work then?
  6 件のコメント
Walter Roberson
Walter Roberson 2012 年 6 月 9 日
Do not use @obj.m -- use @obj
kintali narendra
kintali narendra 2012 年 6 月 9 日
thanku sir it worked...thanku so much

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

その他の回答 (1 件)

Sargondjani
Sargondjani 2012 年 6 月 8 日
apparently you somewhere call a function "obj.m" with an 'double' input and this is not allowed
we can't help much more if you dont post the line where the error occurred and maybe a summary of the code inside obj.m
  2 件のコメント
kintali narendra
kintali narendra 2012 年 6 月 8 日
sir this is the obj.m program
function f = obj(x)
pm=pi/3;
w=0.008;
wt=10;
ws=0.001;
ka=2;
ku=4;
ta=420;
tu=460;
Lu=60;
La=40;
s=(-(x(2)*(w^(-x(4)))*sin((pi/2)*x(4)))+(x(3)*(w^(x(5)))*sin((pi/2)*x(5))));
r=x(1)+((x(2)*(w^(-x(4)))*cos((pi/2)*x(4)))+(x(3)*(w^(x(5)))*cos((pi/2)*x(5))));
f = 20*log10((ku/sqrt((ta*w)^2+1))*sqrt(r^2+s^2));
sir please do tell me if i have made a mistake.....
kintali narendra
kintali narendra 2012 年 6 月 8 日
the above mentioned is my program....

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

Community Treasure Hunt

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

Start Hunting!

Translated by