isstring - Determine if input is string array - MATLAB (original) (raw)

Main Content

Determine if input is string array

Syntax

Description

tf = isstring([A](#bu6eyse-A)) returns 1 (true) if A is a string array. Otherwise, it returns 0 (false).

example

Examples

collapse all

Determine If Array Contains String Values

Create different arrays, and then determine if they are string arrays.

Test a character vector.

Character vectors are not strings, so isstring returns 0.

Test a string array.

str = ["Smith","Chung","Morales"; ... "Sanchez","Peterson","Adams"]

str = 2x3 string "Smith" "Chung" "Morales" "Sanchez" "Peterson" "Adams"

str is a string array, so isstring returns 1.

Input Arguments

collapse all

A — Input array

scalar | vector | matrix | multidimensional array

Input array, specified as a scalar, vector, matrix, or multidimensional array. A can be any data type.

Extended Capabilities

C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

Thread-Based Environment

Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.

This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.

Distributed Arrays

Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.

This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).

Version History

Introduced in R2016b