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 Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by