Integration doesnt work, ndefined function or method 'integral' for input arguments of type 'function_handle'.
古いコメントを表示
Hi to all, I have to solve the following optimization:
theta_cal_const = fmincon(distance , theta0 , [] , [] , [] , [] , lb , ub ,[] ,
options );
with:
distance = @(theta) integral(@(u) integrand(u ,theta),-K, -gap_halfwidth )+ integral(@(u) integrand(u , theta ), gap_halfwidth , K) ;
as a result, matlab returns me the error:
undefined function or method 'integral' for input arguments of type'function_handle'.
Error in ==> fmincon at 517
initVals.f = funfcn{3}(X,varargin{:});
Error in ==> maxLH at 32
theta_cal_const = fmincon(distance , theta0 , [] , [] , [] , [] , lb , ub ,[] ,
options );
Caused by:
Failure in initial user-supplied objective function evaluation. FMINCON cannot
continue.
this is the first time i use fmincon, i dont really understant the error message. Thank you for help
5 件のコメント
Dam
2015 年 3 月 24 日
編集済み: Andrew Newell
2015 年 3 月 24 日
Andrew Newell
2015 年 3 月 24 日
I formatted your code for you. In future, please use the {}Code button to make it readable.
Dam
2015 年 3 月 24 日
Star Strider
2015 年 3 月 24 日
What do you get when you copy, paste, and run these lines in the Command Window:
a = whos('integral')
b = which('integral')
You should get only:
a =
0x1 struct array with fields:
name
... etc.
b =
C:\Program Files\MATLAB\R2015a\toolbox\matlab\funfun\integral.m
Dam
2015 年 3 月 24 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Scope Variables and Generate Names についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!