Error while running ga code. How to use function handler .? Undefined function or variable 'FcnArgs'
19 次查看(过去 30 天)
显示 更早的评论
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..??
0 个评论
回答(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})
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!