File: Validating-the-type-of-Arguments.html

package info (click to toggle)
octave 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 124,192 kB
  • sloc: cpp: 322,665; ansic: 68,088; fortran: 20,980; objc: 8,121; sh: 7,719; yacc: 4,266; lex: 4,123; perl: 1,530; java: 1,366; awk: 1,257; makefile: 424; xml: 147
file content (536 lines) | stat: -rw-r--r-- 22,266 bytes parent folder | download
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Validating the type of Arguments (GNU Octave (version 6.2.0))</title>

<meta name="description" content="Validating the type of Arguments (GNU Octave (version 6.2.0))">
<meta name="keywords" content="Validating the type of Arguments (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Validating-Arguments.html" rel="up" title="Validating Arguments">
<link href="Parsing-Arguments.html" rel="next" title="Parsing Arguments">
<link href="Validating-the-number-of-Arguments.html" rel="prev" title="Validating the number of Arguments">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<span id="Validating-the-type-of-Arguments"></span><div class="header">
<p>
Next: <a href="Parsing-Arguments.html" accesskey="n" rel="next">Parsing Arguments</a>, Previous: <a href="Validating-the-number-of-Arguments.html" accesskey="p" rel="prev">Validating the number of Arguments</a>, Up: <a href="Validating-Arguments.html" accesskey="u" rel="up">Validating Arguments</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="Validating-the-type-of-Arguments-1"></span><h4 class="subsection">11.9.2 Validating the type of Arguments</h4>

<p>Besides the number of arguments, inputs can be checked for various
properties.  <code>validatestring</code> is used for string arguments and
<code>validateattributes</code> for numeric arguments.
</p>
<span id="XREFvalidatestring"></span><dl>
<dt id="index-validatestring">: <em><var>validstr</var> =</em> <strong>validatestring</strong> <em>(<var>str</var>, <var>strarray</var>)</em></dt>
<dt id="index-validatestring-1">: <em><var>validstr</var> =</em> <strong>validatestring</strong> <em>(<var>str</var>, <var>strarray</var>, <var>funcname</var>)</em></dt>
<dt id="index-validatestring-2">: <em><var>validstr</var> =</em> <strong>validatestring</strong> <em>(<var>str</var>, <var>strarray</var>, <var>funcname</var>, <var>varname</var>)</em></dt>
<dt id="index-validatestring-3">: <em><var>validstr</var> =</em> <strong>validatestring</strong> <em>(&hellip;, <var>position</var>)</em></dt>
<dd><p>Verify that <var>str</var> is an element, or substring of an element, in
<var>strarray</var>.
</p>
<p>When <var>str</var> is a character string to be tested, and <var>strarray</var> is a
cellstr of valid values, then <var>validstr</var> will be the validated form
of <var>str</var> where validation is defined as <var>str</var> being a member
or substring of <var>validstr</var>.  This is useful for both verifying
and expanding short options, such as <code>&quot;r&quot;</code>, to their longer forms,
such as <code>&quot;red&quot;</code>.  If <var>str</var> is a substring of <var>validstr</var>, and
there are multiple matches, the shortest match will be returned if all
matches are substrings of each other.  Otherwise, an error will be raised
because the expansion of <var>str</var> is ambiguous.  All comparisons are case
insensitive.
</p>
<p>The additional inputs <var>funcname</var>, <var>varname</var>, and <var>position</var>
are optional and will make any generated validation error message more
specific.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">validatestring (&quot;r&quot;, {&quot;red&quot;, &quot;green&quot;, &quot;blue&quot;})
&rArr; &quot;red&quot;

validatestring (&quot;b&quot;, {&quot;red&quot;, &quot;green&quot;, &quot;blue&quot;, &quot;black&quot;})
&rArr; error: validatestring: multiple unique matches were found for 'b':
   blue, black
</pre></div>


<p><strong>See also:</strong> <a href="Comparing-Strings.html#XREFstrcmp">strcmp</a>, <a href="Comparing-Strings.html#XREFstrcmpi">strcmpi</a>, <a href="#XREFvalidateattributes">validateattributes</a>, <a href="Parsing-Arguments.html#XREFinputParser">inputParser</a>.
</p></dd></dl>


<span id="XREFvalidateattributes"></span><dl>
<dt id="index-validateattributes">: <em></em> <strong>validateattributes</strong> <em>(<var>A</var>, <var>classes</var>, <var>attributes</var>)</em></dt>
<dt id="index-validateattributes-1">: <em></em> <strong>validateattributes</strong> <em>(<var>A</var>, <var>classes</var>, <var>attributes</var>, <var>arg_idx</var>)</em></dt>
<dt id="index-validateattributes-2">: <em></em> <strong>validateattributes</strong> <em>(<var>A</var>, <var>classes</var>, <var>attributes</var>, <var>func_name</var>)</em></dt>
<dt id="index-validateattributes-3">: <em></em> <strong>validateattributes</strong> <em>(<var>A</var>, <var>classes</var>, <var>attributes</var>, <var>func_name</var>, <var>arg_name</var>)</em></dt>
<dt id="index-validateattributes-4">: <em></em> <strong>validateattributes</strong> <em>(<var>A</var>, <var>classes</var>, <var>attributes</var>, <var>func_name</var>, <var>arg_name</var>, <var>arg_idx</var>)</em></dt>
<dd><p>Check validity of input argument.
</p>
<p>Confirms that the argument <var>A</var> is valid by belonging to one of
<var>classes</var>, and holding all of the <var>attributes</var>.  If it does not,
an error is thrown, with a message formatted accordingly.  The error
message can be made further complete by the function name <var>fun_name</var>,
the argument name <var>arg_name</var>, and its position in the input
<var>arg_idx</var>.
</p>
<p><var>classes</var> must be a cell array of strings (an empty cell array is
allowed) with the name of classes (remember that a class name is case
sensitive).  In addition to the class name, the following categories
names are also valid:
</p>
<dl compact="compact">
<dt><code>&quot;float&quot;</code></dt>
<dd><p>Floating point value comprising classes <code>&quot;double&quot;</code> and
<code>&quot;single&quot;</code>.
</p>
</dd>
<dt><code>&quot;integer&quot;</code></dt>
<dd><p>Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64.
</p>
</dd>
<dt><code>&quot;numeric&quot;</code></dt>
<dd><p>Numeric value comprising either a floating point or integer value.
</p>
</dd>
</dl>

<p><var>attributes</var> must be a cell array with names of checks for <var>A</var>.
Some of them require an additional value to be supplied right after the
name (see details for each below).
</p>
<dl compact="compact">
<dt><code>&quot;&lt;=&quot;</code></dt>
<dd><p>All values are less than or equal to the following value in
<var>attributes</var>.
</p>
</dd>
<dt><code>&quot;&lt;&quot;</code></dt>
<dd><p>All values are less than the following value in <var>attributes</var>.
</p>
</dd>
<dt><code>&quot;&gt;=&quot;</code></dt>
<dd><p>All values are greater than or equal to the following value in
<var>attributes</var>.
</p>
</dd>
<dt><code>&quot;&gt;&quot;</code></dt>
<dd><p>All values are greater than the following value in <var>attributes</var>.
</p>
</dd>
<dt><code>&quot;2d&quot;</code></dt>
<dd><p>A 2-dimensional matrix.  Note that vectors and empty matrices have
2 dimensions, one of them being of length 1, or both length 0.
</p>
</dd>
<dt><code>&quot;3d&quot;</code></dt>
<dd><p>Has no more than 3 dimensions.  A 2-dimensional matrix is a 3-D matrix
whose 3rd dimension is of length 1.
</p>
</dd>
<dt><code>&quot;binary&quot;</code></dt>
<dd><p>All values are either 1 or 0.
</p>
</dd>
<dt><code>&quot;column&quot;</code></dt>
<dd><p>Values are arranged in a single column.
</p>
</dd>
<dt><code>&quot;decreasing&quot;</code></dt>
<dd><p>No value is <var>NaN</var>, and each is less than the preceding one.
</p>
</dd>
<dt><code>&quot;diag&quot;</code></dt>
<dd><p>Value is a diagonal matrix.
</p>
</dd>
<dt><code>&quot;even&quot;</code></dt>
<dd><p>All values are even numbers.
</p>
</dd>
<dt><code>&quot;finite&quot;</code></dt>
<dd><p>All values are finite.
</p>
</dd>
<dt><code>&quot;increasing&quot;</code></dt>
<dd><p>No value is <var>NaN</var>, and each is greater than the preceding one.
</p>
</dd>
<dt><code>&quot;integer&quot;</code></dt>
<dd><p>All values are integer.  This is different than using <code>isinteger</code>
which only checks its an integer type.  This checks that each value in
<var>A</var> is an integer value, i.e., it has no decimal part.
</p>
</dd>
<dt><code>&quot;ncols&quot;</code></dt>
<dd><p>Has exactly as many columns as the next value in <var>attributes</var>.
</p>
</dd>
<dt><code>&quot;ndims&quot;</code></dt>
<dd><p>Has exactly as many dimensions as the next value in <var>attributes</var>.
</p>
</dd>
<dt><code>&quot;nondecreasing&quot;</code></dt>
<dd><p>No value is <var>NaN</var>, and each is greater than or equal to the preceding
one.
</p>
</dd>
<dt><code>&quot;nonempty&quot;</code></dt>
<dd><p>It is not empty.
</p>
</dd>
<dt><code>&quot;nonincreasing&quot;</code></dt>
<dd><p>No value is <var>NaN</var>, and each is less than or equal to the preceding one.
</p>
</dd>
<dt><code>&quot;nonnan&quot;</code></dt>
<dd><p>No value is a <code>NaN</code>.
</p>
</dd>
<dt><code>&quot;nonnegative&quot;</code></dt>
<dd><p>All values are non negative.
</p>
</dd>
<dt><code>&quot;nonsparse&quot;</code></dt>
<dd><p>It is not a sparse matrix.
</p>
</dd>
<dt><code>&quot;nonzero&quot;</code></dt>
<dd><p>No value is zero.
</p>
</dd>
<dt><code>&quot;nrows&quot;</code></dt>
<dd><p>Has exactly as many rows as the next value in <var>attributes</var>.
</p>
</dd>
<dt><code>&quot;numel&quot;</code></dt>
<dd><p>Has exactly as many elements as the next value in <var>attributes</var>.
</p>
</dd>
<dt><code>&quot;odd&quot;</code></dt>
<dd><p>All values are odd numbers.
</p>
</dd>
<dt><code>&quot;positive&quot;</code></dt>
<dd><p>All values are positive.
</p>
</dd>
<dt><code>&quot;real&quot;</code></dt>
<dd><p>It is a non-complex matrix.
</p>
</dd>
<dt><code>&quot;row&quot;</code></dt>
<dd><p>Values are arranged in a single row.
</p>
</dd>
<dt><code>&quot;scalar&quot;</code></dt>
<dd><p>It is a scalar.
</p>
</dd>
<dt><code>&quot;size&quot;</code></dt>
<dd><p>Its size has length equal to the values of the next in <var>attributes</var>.
The next value must is an array with the length for each dimension.  To
ignore the check for a certain dimension, the value of <code>NaN</code> can be
used.
</p>
</dd>
<dt><code>&quot;square&quot;</code></dt>
<dd><p>Is a square matrix.
</p>
</dd>
<dt><code>&quot;vector&quot;</code></dt>
<dd><p>Values are arranged in a single vector (column or vector).
</p>
</dd>
</dl>


<p><strong>See also:</strong> <a href="Built_002din-Data-Types.html#XREFisa">isa</a>, <a href="#XREFvalidatestring">validatestring</a>, <a href="Parsing-Arguments.html#XREFinputParser">inputParser</a>.
</p></dd></dl>


<p>As alternatives to <code>validateattributes</code> there are several shorter
convenience functions to check for individual properties.
</p>
<span id="XREFmustBeFinite"></span><dl>
<dt id="index-mustBeFinite">: <em></em> <strong>mustBeFinite</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is finite.
</p>
<p>Raise an error if any element of the input <var>x</var> is not finite, as
determined by <code>isfinite (x)</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNonNan">mustBeNonNan</a>, <a href="Finding-Elements-and-Checking-Conditions.html#XREFisfinite">isfinite</a>.
</p></dd></dl>


<span id="XREFmustBeGreaterThan"></span><dl>
<dt id="index-mustBeGreaterThan">: <em></em> <strong>mustBeGreaterThan</strong> <em>(<var>x</var>, <var>c</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is greater than <var>c</var>.
</p>
<p>Raise an error if any element of the input <var>x</var> is not greater than
<var>c</var>, as determined by <code><var>x</var> &gt; <var>c</var></code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeGreaterThanOrEqual">mustBeGreaterThanOrEqual</a>, <a href="#XREFmustBeLessThan">mustBeLessThan</a>, <a href="Comparison-Ops.html#XREFgt">gt</a>.
</p></dd></dl>


<span id="XREFmustBeGreaterThanOrEqual"></span><dl>
<dt id="index-mustBeGreaterThanOrEqual">: <em></em> <strong>mustBeGreaterThanOrEqual</strong> <em>(<var>x</var>, <var>c</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is greater than or equal to <var>c</var>.
</p>
<p>Raise an error if any element of the input <var>x</var> is not greater than
or equal to <var>c</var>, as determined by <code><var>x</var> &gt;= <var>c</var></code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeGreaterThan">mustBeGreaterThan</a>, <a href="#XREFmustBeLessThanOrEqual">mustBeLessThanOrEqual</a>, <a href="Comparison-Ops.html#XREFge">ge</a>.
</p></dd></dl>


<span id="XREFmustBeInteger"></span><dl>
<dt id="index-mustBeInteger">: <em></em> <strong>mustBeInteger</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is integer-valued (but not necessarily
integer-typed).
</p>
<p>Raise an error if any element of the input <var>x</var> is not a finite,
real, integer-valued numeric value, as determined by various checks.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNumeric">mustBeNumeric</a>.
</p></dd></dl>


<span id="XREFmustBeLessThan"></span><dl>
<dt id="index-mustBeLessThan">: <em></em> <strong>mustBeLessThan</strong> <em>(<var>x</var>, <var>c</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is less than <var>c</var>.
</p>
<p>Raise an error if any element of the input <var>x</var> is not less than
<var>c</var>, as determined by <code><var>x</var> &lt; <var>c</var></code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeLessThanOrEqual">mustBeLessThanOrEqual</a>, <a href="#XREFmustBeGreaterThan">mustBeGreaterThan</a>, <a href="Comparison-Ops.html#XREFlt">lt</a>.
</p></dd></dl>


<span id="XREFmustBeLessThanOrEqual"></span><dl>
<dt id="index-mustBeLessThanOrEqual">: <em></em> <strong>mustBeLessThanOrEqual</strong> <em>(<var>x</var>, <var>c</var>)</em></dt>
<dd>
<p>Require that input is less than or equal to a given value.
</p>
<p>Raise an error if any element of the input <var>x</var> is not less than
or equal to <var>c</var>, as determined by <code><var>x</var> &lt;= <var>c</var></code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeLessThan">mustBeLessThan</a>, <a href="#XREFmustBeGreaterThanOrEqual">mustBeGreaterThanOrEqual</a>, <a href="Comparison-Ops.html#XREFle">le</a>.
</p></dd></dl>


<span id="XREFmustBeMember"></span><dl>
<dt id="index-mustBeMember">: <em></em> <strong>mustBeMember</strong> <em>(<var>x</var>, <var>valid</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is a member of a set of given valid values.
</p>
<p>Raise an error if any element of the input <var>x</var> is not a member
of the set <var>valid</var>, as determined by <code>ismember (<var>x</var>)</code>.
</p>
<p>Programming Note: char inputs may behave strangely because of the
interaction between chars and cellstrings when calling <code>ismember</code> on
them.  But it will probably &quot;do what you mean&quot; if you just use it naturally.
To guarantee operation, convert all char arrays to cellstrings with
<code>cellstr</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNonempty">mustBeNonempty</a>, <a href="Set-Operations.html#XREFismember">ismember</a>.
</p></dd></dl>


<span id="XREFmustBeNegative"></span><dl>
<dt id="index-mustBeNegative">: <em></em> <strong>mustBeNegative</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is negative.
</p>
<p>Raise an error if any element of the input <var>x</var> is not negative, as
determined by <code><var>x</var> &lt; 0</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNonnegative">mustBeNonnegative</a>.
</p></dd></dl>


<span id="XREFmustBeNonempty"></span><dl>
<dt id="index-mustBeNonempty">: <em></em> <strong>mustBeNonempty</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is nonempty.
</p>
<p>Raise an error if the input <var>x</var> is empty, as determined by
<code>isempty (<var>x</var>)</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeMember">mustBeMember</a>, <a href="#XREFmustBeNonzero">mustBeNonzero</a>, <a href="Object-Sizes.html#XREFisempty">isempty</a>.
</p></dd></dl>


<span id="XREFmustBeNonNan"></span><dl>
<dt id="index-mustBeNonNan">: <em></em> <strong>mustBeNonNan</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is non-<code>NaN</code>.
</p>
<p>Raise an error if any element of the input <var>x</var> is <code>NaN</code>, as
determined by <code>isnan (<var>x</var>)</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeFinite">mustBeFinite</a>, <a href="#XREFmustBeNonempty">mustBeNonempty</a>, <a href="Finding-Elements-and-Checking-Conditions.html#XREFisnan">isnan</a>.
</p></dd></dl>


<span id="XREFmustBeNonnegative"></span><dl>
<dt id="index-mustBeNonnegative">: <em></em> <strong>mustBeNonnegative</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is not negative.
</p>
<p>Raise an error if any element of the input <var>x</var> is negative, as
determined by <code><var>x</var> &gt;= 0</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNonzero">mustBeNonzero</a>, <a href="#XREFmustBePositive">mustBePositive</a>.
</p></dd></dl>


<span id="XREFmustBeNonpositive"></span><dl>
<dt id="index-mustBeNonpositive">: <em></em> <strong>mustBeNonpositive</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is not positive.
</p>
<p>Raise an error if any element of the input <var>x</var> is positive, as
determined by <code><var>x</var> &lt;= 0</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNegative">mustBeNegative</a>, <a href="#XREFmustBeNonzero">mustBeNonzero</a>.
</p></dd></dl>


<span id="XREFmustBeNonsparse"></span><dl>
<dt id="index-mustBeNonsparse">: <em></em> <strong>mustBeNonsparse</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is not sparse.
</p>
<p>Raise an error if the input <var>x</var> is sparse, as determined by
<code>issparse (<var>x</var>)</code>.
</p>

<p><strong>See also:</strong> <a href="Information.html#XREFissparse">issparse</a>.
</p></dd></dl>


<span id="XREFmustBeNonzero"></span><dl>
<dt id="index-mustBeNonzero">: <em></em> <strong>mustBeNonzero</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is not zero.
</p>
<p>Raise an error if any element of the input <var>x</var> is zero, as determined
by <code><var>x</var> == 0</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNonnegative">mustBeNonnegative</a>, <a href="#XREFmustBePositive">mustBePositive</a>.
</p></dd></dl>


<span id="XREFmustBeNumeric"></span><dl>
<dt id="index-mustBeNumeric">: <em></em> <strong>mustBeNumeric</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is numeric.
</p>
<p>Raise an error if the input <var>x</var> is not numeric, as determined by
<code>isnumeric (<var>x</var>)</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNumericOrLogical">mustBeNumericOrLogical</a>, <a href="Predicates-for-Numeric-Objects.html#XREFisnumeric">isnumeric</a>.
</p></dd></dl>


<span id="XREFmustBeNumericOrLogical"></span><dl>
<dt id="index-mustBeNumericOrLogical">: <em></em> <strong>mustBeNumericOrLogical</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is numeric or logical.
</p>
<p>Raise an error if the input <var>x</var> is not numeric or logical, as
determined by <code>isnumeric (<var>x</var>) || islogical (<var>x</var>)</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNumeric">mustBeNumeric</a>, <a href="Predicates-for-Numeric-Objects.html#XREFisnumeric">isnumeric</a>, <a href="Predicates-for-Numeric-Objects.html#XREFislogical">islogical</a>.
</p></dd></dl>


<span id="XREFmustBePositive"></span><dl>
<dt id="index-mustBePositive">: <em></em> <strong>mustBePositive</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is positive.
</p>
<p>Raise an error if any element of the input <var>x</var> is not positive, as
determined by <code><var>x</var> &gt; 0</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeNonnegative">mustBeNonnegative</a>, <a href="#XREFmustBeNonzero">mustBeNonzero</a>.
</p></dd></dl>


<span id="XREFmustBeReal"></span><dl>
<dt id="index-mustBeReal">: <em></em> <strong>mustBeReal</strong> <em>(<var>x</var>)</em></dt>
<dd>
<p>Require that input <var>x</var> is real.
</p>
<p>Raise an error if the input <var>x</var> is not real, as determined by
<code>isreal (<var>x</var>)</code>.
</p>

<p><strong>See also:</strong> <a href="#XREFmustBeFinite">mustBeFinite</a>, <a href="#XREFmustBeNonNan">mustBeNonNan</a>, <a href="Predicates-for-Numeric-Objects.html#XREFisreal">isreal</a>.
</p></dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="Parsing-Arguments.html" accesskey="n" rel="next">Parsing Arguments</a>, Previous: <a href="Validating-the-number-of-Arguments.html" accesskey="p" rel="prev">Validating the number of Arguments</a>, Up: <a href="Validating-Arguments.html" accesskey="u" rel="up">Validating Arguments</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>