MATLAB Function Reference    
is*

Detect state

Syntax

Description

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 = 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 NaNs 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.

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.

Examples

Given,

isequal(A,B,C) returns 0, and isequal(A,B) returns 1.

Let

Then

and

See Also

isappdata, ishandle, ishold, isjava, iskeyword, ismember, isstr, isvalid, isvarname


 ipermute isa