Skip to content
Snippets Groups Projects
Commit 9a5fc001 authored by Jacob Smith's avatar Jacob Smith
Browse files

fixed csminwel to be able to take anonymous functions as well

parent a6918add
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,11 @@ snit=100;
% tailstr=[ ',P' num2str(i) tailstr];
% stailstr=[' P' num2str(i) stailstr];
%end
if ischar(fcn)
f0 = eval([fcn '(x0,varargin{:})']);
else
f0 = fcn(x0,varargin{:});
end
%ARGLIST
%f0 = feval(fcn,x0,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13);
% disp('first fcn in csminwel.m ----------------') % Jinill on 9/5/95
......
......@@ -26,7 +26,11 @@ x0 = x0(:);
%for i=nargin-3:-1:1
% tailstr=[ ',P' num2str(i) tailstr];
%end
if ischar(fcn)
f0 = eval([fcn '(x0,varargin{:})']);
else
f0 = fcn(x0,varargin{:});
end
%f0 = eval([fcn '(x0' tailstr]);
% ** initializations
......@@ -60,8 +64,15 @@ badg=0;
i = 0;
while i ~= n
i = i+1;
if ischar(fcn)
fp = eval([fcn '(argplus(:,i),varargin{:})']);
fm = eval([fcn '(argminus(:,i),varargin{:})']);
else
fp = fcn(argplus(:,i),varargin{:});
fm = fcn(argminus(:,i),varargin{:});
end
% fp = eval([fcn '(argplus(:,i)' tailstr]);
% fm = eval([fcn '(argminus(:,i)' tailstr]);
g0 = fp - fm;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment