|
|
| File Information |
| Description |
%assert(testCondition)
% Evaluates the test condition in the caller's context. If the result is
% false, an error is thrown indicating that the test failed.
% TESTCONDITION should be a string.
%
%assert(truthValue)
%assert(truthValue,errMsg)
% If TRUTHVALUE is zero, an error is thrown. The text of the error
% contains ERRMSG if supplied. This version of ASSERT was made to
% promote compatibility with Kevin Murphy's Bayes Net Toolbox (i.e. he
% uses this syntax). TRUTHVALUE must be a logical or a number.
%
%EXAMPLES:
% assert('1==2') ==> assertion error generated
% assert(1==2) ==> assertion error generated (BNT syntax)
% assert 1==2; ==> assertion error generated
% x=1; assert('x==1') ==> no error
% x=1; assert x==1; ==> no error
% assert('{a==3') ==> error generated by Matlab (bad assert code) |
| Acknowledgements |
This submission has inspired the following:
Assertion function
|
| MATLAB release |
MATLAB 7.0.4 (R14SP2)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (4) |
| 17 Feb 2006 |
Duane Hanselman
|
|
|
| 17 Mar 2007 |
Roger Krill
|
|
|
| 31 Mar 2007 |
Naveen Mishra
|
|
|
| 25 Apr 2008 |
Ben FrantzDale
|
|
|
| Updates |
|
quick bug fix relative to the last update (which added support for Kevin Murphy's syntax) |
| 21 Feb 2006 |
Removed boilerplate copyright. |
| 07 Nov 2006 |
quick bug fix relative to the last update (which added support for Kevin Murphy's syntax) |
|
Contact us at files@mathworks.com