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!