Error while running ga code. How to use function handler .? Undefined function or variable 'FcnArgs'
이전 댓글 표시
I have error while running my M file.
My function handler is as follows
h=@(x) rmse_test(x,FcnArgs{net:inputs:target});
But i'm getting error like this
Undefined function or variable 'FcnArgs'.
Error in genetic_algorithm (line 25)
h = @(x) rmse_test(x,FcnArgs{net:inputs:targets});
createAnonymousFcn is inbuilt function like this
function fcn_handle = createAnonymousFcn(fcn,FcnArgs)
%CREATEFUNCTIONHANDLE create an anonymous function handle
%
% fcn: A function handle
% args: A cell array of extra arguments to user's objective/constraint
% function
% Copyright 2011 The MathWorks, Inc.
% $Revision: 1.1.6.1 $Date: 2011/10/27 00:34:50 $
fcn_handle = @(x) fcn(x,FcnArgs{:});
Could anyone help me to solve this error..??
답변 (1개)
Walter Roberson
2016년 4월 5일
Your function handler should not be that. Your function handler should be the result of calling
createAnonymousFcn( @rmse_test, {net, inputs, target})
댓글 수: 3
Priya Dharshini
2016년 4월 5일
편집: Priya Dharshini
2016년 4월 5일
Walter Roberson
2016년 4월 5일
h = createAnonymousFcn( @rmse_test, {net, inputs, target});
Priya Dharshini
2016년 4월 6일
편집: Priya Dharshini
2016년 4월 6일
카테고리
도움말 센터 및 File Exchange에서 Choose a Solver에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!