Is there a function that will display all the fields of a nested structure in MATLAB?

118 visualizaciones (últimos 30 días)
I have a nested structure, containing levels of structures within it.
I would like to be able to view all the fields of this nested structure.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 17 de Oct. de 2016
There is not a built in function in MATLAB that would display the contents of a nested structure hierarchy.
You can achieve this by writing a function that recursively navigates through each field of the structure and displays its contents.
Find attached an example file, unfold.m, which displays the contents of nested structures. The help contents of the function contain more information on its usage.
  1 comentario
KAE
KAE el 20 de Nov. de 2019
This is useful for looking at multi-level XML files read in by xml2struct. I wish there were more XML utilities in Matlab to make it easy to extract data from many records.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2006b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by