Main Content

isfloat

Determine if input is floating-point array

Description

tf = isfloat(A) returns true if A is a floating-point array and false otherwise. The floating-point types are single and double.

example

Examples

collapse all

These examples show the values isfloat returns when passed specific types:

% pi returns a floating-point value
isfloat(pi)
ans = logical
   1

% Complex numbers are floating-point values
isfloat(3+7i)
ans = logical
   1

% Single-precision numbers are floating-point values
isfloat(realmax('single'))
ans = logical
   1

% isfloat returns a logical value
isfloat(isfloat(pi))
ans = logical
   0

Input Arguments

collapse all

Input array, specified as a scalar, vector, matrix, or multidimensional array. Floating-point types in MATLAB® include single and double (and subclasses of single and double).

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced before R2006a