How to define functions in MATLAB.
Mostrar comentarios más antiguos
while writing the code
ff='testfunction';
cost=feval(ff,par);
I got the error undefined function testfunction for input arguments of type double.
Respuestas (1)
Image Analyst
el 16 de Nov. de 2013
You need to do this:
function results = testfunction(ff, par)
cost=feval(ff,par);
results = ..... whatever, more code to assign results.
and save it as testfunction.m.
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!