diff +grid/evalOn.m @ 809:94f0f0b0d721 feature/poroelastic

Allow functions with variable number of arguments in grid.evalOn
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 27 Jul 2018 10:13:02 -0700
parents 0609a72dcdfe
children 77451445955f
line wrap: on
line diff
--- a/+grid/evalOn.m	Fri Jul 27 10:03:21 2018 -0700
+++ b/+grid/evalOn.m	Fri Jul 27 10:13:02 2018 -0700
@@ -13,7 +13,7 @@
         return
     end
     % func should now be a function_handle
-    assert(g.D == nargin(func),'grid:evalOn:WrongNumberOfInputs', 'The number of inputs of the function must match the dimension of the domain.')
+    assert(g.D == nargin(func) || nargin(func) < 0,'grid:evalOn:WrongNumberOfInputs', 'The number of inputs of the function must match the dimension of the domain.')
 
     x = num2cell(g.points(),1);
     k = numberOfComponents(func);