How to transform struct to array?

조회 수: 15 (최근 30일)
Kiryl Zhaliazka
Kiryl Zhaliazka 2022년 3월 23일
답변: Voss 2022년 3월 23일
I have struct with 96 fields, each field contein 1 number, how I can make array that will be contain one column and 96 rows, each row is a number from each field. Thank you.

채택된 답변

Voss
Voss 2022년 3월 23일
S = struct('field_1',1,'field_2',2,'field_3',3)
S = struct with fields:
field_1: 1 field_2: 2 field_3: 3
A = struct2array(S).'
A = 3×1
1 2 3

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by