Main Content

isstruct

Determine if input is structure array

Description

tf = isstruct(A) returns logical 1 (true) if A is a MATLAB® structure array and logical 0 (false) otherwise.

example

Examples

collapse all

Create a structure array.

S = struct("a",[1;2;3],"b",ones(3),"c",magic(3))
S = struct with fields:
    a: [3x1 double]
    b: [3x3 double]
    c: [3x3 double]

Determine if S is a structure array.

tf = isstruct(S)
tf = logical
   1

Convert the structure array to a table.

T = struct2table(S)
T=3×3 table
    a         b              c     
    _    ___________    ___________

    1    1    1    1    8    1    6
    2    1    1    1    3    5    7
    3    1    1    1    4    9    2

Verify that T is not a structure array.

tf = isstruct(T)
tf = logical
   0

Input Arguments

collapse all

Input array, specified as a scalar, vector, matrix, or multidimensional array of any data type.

Extended Capabilities

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

Version History

Introduced before R2006a