function feval

5 次查看(过去 30 天)
Krishnendu Mukherjee
??? Error using ==> feval
Attempt to execute SCRIPT untitled2 as a function.
Error in ==> C:\Documents and Settings\krishnendu\Desktop\Chared ICA Code\ImperialistCompetitveAlgorithm_GlobalOptimizationStrategy.m
On line 83 ==> InitialCost = feval(ProblemParams.CostFuncName,InitialCountries,ProblemParams.CostFuncExtraParams);
im getting this error.
  3 个评论
TAB
TAB 2012-1-27
>> doc feval
Walter Roberson
Walter Roberson 2012-1-27
We need the context.

请先登录,再进行评论。

采纳的回答

Honglei Chen
Honglei Chen 2012-1-27
It looks like your untitled2 is a script, not a function, hence cannot be evaluated by feval. To define a function, you need to have, e.g.
function y = foo(x)
in your foo.m as the first line and then you can do
y = feval(@foo,x)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler SDK 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by