# HG changeset patch # User Carlo de Falco # Date 1477306398 -7200 # Mon Oct 24 12:53:18 2016 +0200 # Branch stable # Node ID 2b4a5eedb4e04bae535d82c76d72958f0c581186 # Parent 6b134d294d61aaf27ea3e1c4ca060d2c4eb7d5d0 Use numfields () instead of isempty () to check for empty struct in odeset. * scripts/ode/odeset.m : extract fields of p.Unmatched only when actually needed. diff --git a/scripts/ode/odeset.m b/scripts/ode/odeset.m --- a/scripts/ode/odeset.m +++ b/scripts/ode/odeset.m @@ -182,10 +182,11 @@ else p.parse (varargin{:}); odestruct = p.Results; - odestruct_extra = p.Unmatched; - xtra_fields = fieldnames (odestruct_extra); - if (! isempty (xtra_fields)) + if (numfields (p.Unmatched) >= 0) + odestruct_extra = p.Unmatched; + xtra_fields = fieldnames (odestruct_extra); + ## Merge extra fields into existing odestruct for fldname = sort (xtra_fields.') fldname = fldname{1};