How to combine structures with the same name fields?

조회 수: 21 (최근 30일)
rbme17
rbme17 2018년 9월 21일
댓글: rbme17 2018년 9월 21일
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

채택된 답변

Fangjun Jiang
Fangjun Jiang 2018년 9월 21일
Did you try
New=[xswn; xsw_]
  댓글 수: 3
rbme17
rbme17 2018년 9월 21일
@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!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by