home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 5.ddi / SPLINES.DI$ / ZCHECK.M < prev   
Encoding:
Text File  |  1993-03-11  |  514 b   |  21 lines

  1. function e = zcheck(x)
  2. %ZCHECK    ZCHECK checks to see if a result is 0.
  3. %    ZCHECK(X) is used to test that a result is 0
  4. %    to within sqrt(eps) and issues an error if not.
  5. %    
  6.  
  7. %    Copyright (c) 1990 by the MathWorks, Inc.
  8. %    Written by John N. Little, 12-8-84.
  9.  
  10. if min(size(x)) == 0
  11.     error([7,'Somebody returned a NULL matrix'])
  12. end
  13. if any(any(isnan(x)))
  14.     error([7, 'Somebody returned a NaN'])
  15. end
  16. e = norm(x,1);
  17. if (e > sqrt(eps))
  18.     Residual_norm = e
  19.     error([7, 'Residual greater than sqrt(Eps)'])
  20. end
  21.