Documentation

iscategorical

Determine whether input is categorical array

Syntax

tf = iscategorical(A)

Description

example

tf = iscategorical(A)returns logical1(true) ifAis a categorical array. Otherwise,iscategoricalreturns logical0(false).

Examples

collapse all

Create a workspace variable,A.

A = categorical({'red''green''violet';'orange''red''yellow'})
A =2×3 categorical arrayred green violet orange red yellow

Verify that the workspace variable,A, is a categorical array.

tf = iscategorical(A)
tf =logical1

Ais a 2-by-3 categorical array.

Input Arguments

collapse all

Input variable, specified as a workspace variable.Acan be any data type.

Introduced in R2013b

Was this topic helpful?