1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>ISEMPTY Test For Variable Empty
</TITLE>
</HEAD>
<BODY>
<H2>ISEMPTY Test For Variable Empty
</H2>
<P>
Section: <A HREF=sec_inspection.html> Inspection Functions </A>
<H3>Usage</H3>
The <code>isempty</code> function returns a boolean that indicates
if the argument variable is empty or not. The general
syntax for its use is
<PRE>
y = isempty(x).
</PRE>
<P>
<H3>Examples</H3>
Here are some examples of the <code>isempty</code> function
<PRE>
--> a = []
a =
[]
--> isempty(a)
ans =
1
--> b = 1:3
b =
1 2 3
--> isempty(b)
ans =
0
</PRE>
<P>
Note that if the variable is not defined, <code>isempty</code>
does not return true.
<PRE>
--> clear x
--> isempty(x)
Error: Undefined function or variable x
</PRE>
<P>
</BODY>
</HTML>
|