function feval

5 Ansichten (letzte 30 Tage)
Krishnendu Mukherjee
Krishnendu Mukherjee am 27 Jan. 2012
??? 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 Kommentare
TAB
TAB am 27 Jan. 2012
>> doc feval
Walter Roberson
Walter Roberson am 27 Jan. 2012
We need the context.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 27 Jan. 2012
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)

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Compiler SDK finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by