Main Content

isfloat

Determine if input is floating-point array

Description

example

tf= isfloat(A)returnstrueifAis a floating-point array andfalseotherwise. The floating-point types aresingleanddouble.

Examples

collapse all

These examples show the valuesisfloatreturns when passed specific types:

% pi returns a floating-point valueisfloat(pi)
ans =logical1
% Complex numbers are floating-point valuesisfloat(3+7i)
ans =logical1
% Single-precision numbers are floating-point valuesisfloat(realmax('single'))
ans =logical1
% isfloat returns a logical valueisfloat(isfloat(pi))
ans =logical0

Input Arguments

collapse all

Input array, specified as a scalar, vector, matrix, or multidimensional array. Floating-point types in MATLAB®includesingleanddouble(and subclasses ofsingleanddouble).

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