changeset 12637:01b19426d64d octave-forge

Added warning for Inf/NaN coefficients
author rafavzqz
date Tue, 16 Jun 2015 07:52:10 +0000
parents 1856200c84b1
children b3a8fa6de43d
files extra/nurbs/inst/nrbderiv.m
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/extra/nurbs/inst/nrbderiv.m	Tue Jun 16 07:16:51 2015 +0000
+++ b/extra/nurbs/inst/nrbderiv.m	Tue Jun 16 07:52:10 2015 +0000
@@ -216,6 +216,15 @@
 varargout{1} = dnurbs;
 if (nargout == 2)
   varargout{2} = dnurbs2;
+  
+  if (iscell (dnurbs2))
+    dnurbs2 = [dnurbs2{:}];
+  end
+  if (any (arrayfun(@(x) any(isnan(x.coefs(:)) | iscell(x.coefs(:))), dnurbs2)))
+    warning (['The structure for the second derivative contains Inf and/or NaN coefficients, ' ...
+        'probably due to low continuity at repeated knots. This should not affect the ' ...
+        'computation of the second derivatives, except at those knots.'])
+  end
 end
 
 end