How to define functions in MATLAB.
이전 댓글 표시
while writing the code
ff='testfunction';
cost=feval(ff,par);
I got the error undefined function testfunction for input arguments of type double.
답변 (1개)
Image Analyst
2013년 11월 16일
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.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!