fevals - feval with parameters (substitute for function handles in <=R13) Copyright(c) 2009 Ryota Tomioka This software is distributed under the MIT license. See license.txt
0001 % fevals - feval with parameters (substitute for function handles in <=R13) 0002 % 0003 % Copyright(c) 2009 Ryota Tomioka 0004 % This software is distributed under the MIT license. See license.txt 0005 function varargout=fevals(func, varargin) 0006 0007 if iscell(func) 0008 if length(func)>1 0009 param=func(2:end); 0010 func =func{1}; 0011 else 0012 func =func{1}; 0013 param=[]; 0014 end 0015 else 0016 param=[]; 0017 end 0018 0019 param = [varargin param]; 0020 varargout=cell(1,nargout); 0021 [varargout{:}]=feval(func,param{:});