MATLAB Help Center
Determine if input is structure array
tf = isstruct(A)
tf = isstruct(A) returns logical 1 (true) if A is a MATLAB® structure array and logical 0 (false) otherwise.
A
1
true
0
false
example
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.
S
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.
T
tf = isstruct(T)
tf = logical 0
Input array, specified as a scalar, vector, matrix, or multidimensional array of any data type.
backgroundPool
ThreadPool
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Introduced before R2006a
struct
istable
isfield
iscell
ischar
isobject
isnumeric
islogical
isa
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office