How to combine structures with the same name fields?

23 vues (au cours des 30 derniers jours)
rbme17
rbme17 le 21 Sep 2018
Commenté : rbme17 le 21 Sep 2018
I've tried looking at other threads on here to see if they applied to me but I couldn't find any. I have several structures, all with the same name fields (two of five shown below).
I wanted to combine these structures of different sizes to make one bigger structure, with the same name fields, so I can later import the single structure into excel. How can I accomplish this?
_
xswn =
26×1 struct array with fields:
name
folder
date
bytes
isdir
datenum
xsw_ =
41×1 struct array with fields:
name
folder
date
bytes
isdir
datenum

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 21 Sep 2018
Did you try
New=[xswn; xsw_]
  3 commentaires
rbme17
rbme17 le 21 Sep 2018
@Stephen Cobeldick Thanks for the resources. I've only recently been exposed to structures and don't have the strongest background in matlab. Just happy there's help out there!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by