How can I create a structure array for two files?

조회 수: 7 (최근 30일)
Dhiyaa Al-Shammari
Dhiyaa Al-Shammari 2020년 5월 26일
댓글: Stephen23 2020년 5월 27일
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일
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일
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개)

카테고리

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