MATLAB Function Reference | Search  Help Desk |
is* | Examples |
is*
k = iscell(C) k = islogical(A) k = iscellstr(S) TF = isnan(A) k = ischar(S) k = isnumeric(A) k = isempty(A) k = isobject(A) k = isequal(A,B,...) k = isppc k = isfield(S,'field
') TF = isprime(A) TF = isfinite(A) k = isreal(A) k = isglobal(NAME) TF = isspace('str
') TF = ishandle(H) k = issparse(S) k = ishold k = isstruct(S) k = isieee k = isstudent TF = isinf(A) k = isunix TF = isletter('str
') k = isvms
k = iscell(C)
returns logical true (1
) if C
is a cell array and logical false (0
) otherwise.
k = iscellstr(S)
returns logical true (1
) if S
is a cell array of strings and logical false (0
) otherwise. A cell array of strings is a cell array where every element is a character array.
k = ischar(S)
returns logical true (1
) if S
is a character array and logical false (0
) otherwise.
k = isempty(A)
returns logical true (1
) if A
is an empty array and logical false (0
) otherwise. An empty array has at least one dimension of size zero, for example, 0-by-0 or 0-by-5.
k = isequal(A,B,...)
returns logical true (1
) if the input arrays are the same type and size and hold the same contents, and logical false (0
) otherwise.
k = isfield(S,'field
')
returns logical true (1
) if field
is the name of a field in the structure array S
.
TF = isfinite(A)
returns an array the same size as A
containing logical true (1
) where the elements of the array A
are finite and logical false (0
) where they are infinite or NaN
.
For any A
, exactly one of the three quantities isfinite(A)
, isinf(A)
, and isnan(A)
is equal to one.
k = isglobal(NAME)
returns logical true (1
) if NAME
has been declared to be a global variable, and logical false (0
) if it has not been so declared.
TF = ishandle(H)
returns an array the same size as H
that contains logical true (1
) where the elements of H
are valid graphics handles and logical false (0
)where they are not.
k = ishold
returns logical true (1
) if hold
is on
, and logical false (0
) if it is off
. When hold
is on
, the current plot and all axis properties are held so that subsequent graphing commands add to the existing graph. hold on
means the NextPlot
property of both figure and axes is set to add
.
k = isieee
returns logical true (1
) on machines with IEEE arithmetic (e.g., IBM PC, most UNIX workstations, Macintosh) and logical false (0
) on machines without IEEE arithmetic (e.g., VAX, Cray).
TF = isinf(A)
returns an array the same size as A
containing logical true (1
) where the elements of A
are +Inf
or -Inf
and logical false (0
) where they are not.
TF = isletter('str
')
returns an array the same size as '
str
'
containing logical true (1
) where the elements of str
are letters of the alphabet and logical false (0
) where they are not.
k = islogical(A)
returns logical true (1
) if A
is a logical array and logical false (0
) otherwise.
TF = isnan(A)
returns an array the same size as A
containing logical true (1
) where the elements of A
are NaN
s and logical false (0
) where they are not.
k = isnumeric(A)
returns logical true (1
) if A is a numeric array and logical false (0
) otherwise. For example, sparse arrays, and double precision arrays are numeric while strings, cell arrays, and structure arrays are not.
k = isobject(A)
returns logical true (1
) if A is an object and logical false (0
) otherwise.
k = isppc
returns logical true (1
) if the computer running MATLAB is a Macintosh Power PC and logical false (0
) otherwise.
TF = isprime(A)
returns an array the same size as A
containing logical true (1
) for the elements of A
which are prime, and logical false (0
) otherwise.
k = isreal(A)
returns logical true (1
) if all elements of A
are real numbers, and logical false (0
) if either A
is not a numeric array, or if any element of A
has a nonzero imaginary component. Since strings are a subclass of numeric arrays, isreal
always returns 1
for a string input.
Because MATLAB supports complex arithmetic, certain of its functions can introduce significant imaginary components during the course of calculations that appear to be limited to real numbers. Thus, you should use isreal
with discretion.
TF = isspace('str
')
returns an array the same size as '
str
' containing logical true (1
) where the elements of str
are ASCII white spaces and logical false (0
) where they are not. White spaces in ASCII are space, newline, carriage return, tab, vertical tab, or formfeed characters.
k = issparse(S)
returns logical true (1
) if the storage class of S
is sparse and logical false (0
) otherwise.
k = isstruct(S)
returns logical true (1
) if S
is a structure and logical false (0
) otherwise.
k = isstudent
returns logical true (1
) for student editions of MATLAB and logical false (0
) for commercial editions.
k = isunix
returns logical true (1
) for UNIX versions of MATLAB and logical false (0
) otherwise.
k = isvms
returns logical true (1
) for VMS versions of MATLAB and logical false (0
) otherwise.
s = 'A1,B2,C3'; isletter(s) ans = 1 0 0 1 0 0 1 0 B = rand(2,2,2); B(:,:,:) = []; isempty(B) ans = 1Given,
A = B = C = 1 0 1 0 1 0 0 1 0 1 0 0
isequal(A,B,C)
returns 0
, and isequal(A,B)
returns 1
.
Let
a = [-2 -1 0 1 2]Then
isfinite(1./a) = [1 1 0 1 1] isinf(1./a) = [0 0 1 0 0] isnan(1./a) = [0 0 0 0 0]and
isfinite(0./a) = [1 1 0 1 1] isinf(0./a) = [0 0 0 0 0] isnan(0./a) = [0 0 1 0 0]