Home > atmlab > math > isboolean.m

isboolean

PURPOSE ^

ISBOOLEAN True for boolean variables.

SYNOPSIS ^

function bool = isboolean( a )

DESCRIPTION ^

 ISBOOLEAN   True for boolean variables.

    Determines if a variable is a boolean, that is, a logical with size 1x1.

 FORMAT   bool = isboolean(a)
        
 OUT   bool   true if boolean, else false.
 IN    a      A variable of any data type.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

isboolean.m

SOURCE CODE ^

0001 % ISBOOLEAN   True for boolean variables.
0002 %
0003 %    Determines if a variable is a boolean, that is, a logical with size 1x1.
0004 %
0005 % FORMAT   bool = isboolean(a)
0006 %
0007 % OUT   bool   true if boolean, else false.
0008 % IN    a      A variable of any data type.
0009 
0010 % 2010-01-03  Created by Patrick Eriksson.
0011 
0012 
0013 function bool = isboolean( a )
0014 
0015 bool = islogical( a )  &&  max(size(a)) == 1;
0016 
0017

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005