Commit 8fa461b9 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added a test on the first input argument. If func is a function handle, then...

Added a test on the first input argument. If func is a function handle, then str2func should not be used.
parent d56d35f1
......@@ -35,7 +35,9 @@ function hessian_mat = hessian(func,x,gstep,varargin)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
func = str2func(func);
if ~isa(func, 'function_handle')
func = str2func(func);
end
n=size(x,1);
h1=max(abs(x),sqrt(gstep)*ones(n,1))*eps^(1/6);
h_1=h1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment