How can I create a structure array for two files?

I want to add the following into a structure array
the name of structure array is ECGData as follows
conssists of the following
How can I add the two fields(Data as a matrix array & Labels as cell array) into ECGData

6 件のコメント

Rik
Rik 2020 年 5 月 26 日
You mean ECGData should be a 162x1 array with a scalar cell Label and a 1x65536 double Data?
Dhiyaa Al-Shammari
Dhiyaa Al-Shammari 2020 年 5 月 26 日
Yes, I want to embed the two Data 162x65536 as well as Labels 162x1 into one struct ECGData.
Rik
Rik 2020 年 5 月 26 日
That does not match what I said. You already have a 1x1 struct with fields with the sizes you describe. My question was if you want a 162x1 struct instead.
Dhiyaa Al-Shammari
Dhiyaa Al-Shammari 2020 年 5 月 26 日
inside this link found the ECGData that contain two fields Data 162x65536 as well as Labels 162x1
Rik
Rik 2020 年 5 月 26 日
What is your question? You want a struct with these two fields, and you have a struct with these two fields.
Dhiyaa Al-Shammari
Dhiyaa Al-Shammari 2020 年 5 月 26 日
編集済み: Dhiyaa Al-Shammari 2020 年 5 月 26 日
Exactly , yes I want the code like that. How can I do that ?

サインインしてコメントする。

 採用された回答

Rik
Rik 2020 年 5 月 26 日

1 投票

You can treat fields of a struct just like any other variable:
ECGData=struct;%create empty struct, this isn't mandatory
ECGData.Data=rand(162,65536);
ECGData.Labels=cell(162,1);

1 件のコメント

Stephen23
Stephen23 2020 年 5 月 27 日
Dhiyaa Al-Shammari's incorrectly posted and accepted "answer" moved here:
Thanks a lot dear brother.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

質問済み:

2020 年 5 月 26 日

コメント済み:

2020 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by