diff +grid/evalOn.m @ 277:4c3f55a628c8 feature/beams

Made evalOn give more error message.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 07 Sep 2016 13:47:05 +0200
parents 30321dc180e1
children ce44af8d7dd1
line wrap: on
line diff
--- a/+grid/evalOn.m	Wed Sep 07 10:13:26 2016 +0200
+++ b/+grid/evalOn.m	Wed Sep 07 13:47:05 2016 +0200
@@ -16,6 +16,13 @@
     end
     % func should now be a function_handle
 
+    if g.D ~= nargin(func)
+        g.D
+        nargin(func)
+        error('grid:evalOn:WrongNumberOfInputs', 'The number of inputs of the function must match the dimension of the domain.')
+    end
+
+
     % Get coordinates and convert to cell array for easier use as a parameter
     x = num2cell(g.points());