No BSD License  

Highlights from
DSTV: Datashape & -type Verification

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 6.54 KB File ID: #8847

DSTV: Datashape & -type Verification

by Ingo Löhken

 

27 Oct 2005 (Updated 28 Oct 2005)

Enables reflective data verification.

| Watch this File

File Information
Description

Solves the common problem of massive branching (if-then-elseif-...-end) and repetetive error condition statments by introducing a simple reflective mechanism in programming techniques.

The well known verification functions NARGCHK and NARGOUTCHK return an appropiate error message, if the number of in- resp outputs is not correct.

The ARGCHK function also returns an appropiate error message, but the clue is, the error condition is the message. Therefore any expression evaluatable to a logical condition may be error condition an error message at once.

Brief Example
error(argchk('isnumeric(X)'))
ARGCHK returns the message MSG = '~isnumeric(X)' and ERROR displays MSG and aborts function, if X is not numeric, otherwise ARGCHK returns an empty message MSG = '', so that ERROR takes no action.

As obvious, the power of the function is in the flexibility, to use any kind of expression evaluatable to a logical expression. Due to this any user defined logical function may be used for more understandable error messages.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
argchk Ingo Löhken 22 Oct 2008 08:05:01
type Ingo Löhken 22 Oct 2008 08:05:01
shape Ingo Löhken 22 Oct 2008 08:05:01
verification Ingo Löhken 22 Oct 2008 08:05:01
error handling Ingo Löhken 22 Oct 2008 08:05:01
check Ingo Löhken 22 Oct 2008 08:05:01

Contact us at files@mathworks.com