Hello everybody,
i have an automatically generated cell array with ceveral structs inside of it. The size of every struct array is identical and has its own datetime field.
What i want to do is to sort the different structs in the cell array by their measurement date/time.
I tried it with the way below but didn´t get the result i expected.
for runs=1:iMess
data.Runs{runs, 1}=struct2table;
date_list = [data.Runs{runs, 1}(1).MeasBegin];
[~, data.Nebenvariablen.date] = sort(date_list);
data.Runs{runs, 1} = data.Runs{runs, 1}(data.Nebenvariablen.date);
end
I hope you can help me with this.

댓글 수: 2

Kaan Aydin
Kaan Aydin 2020년 7월 24일
of course the second line should be
data.Runs{runs, 1}=struct2table(data.Runs{runs,1});
dpb
dpb 2020년 7월 24일
Attach the struct array.

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

 채택된 답변

Jalaj Gambhir
Jalaj Gambhir 2020년 7월 27일

0 개 추천

Hi,
Please provide the struct for us to give you the exact solution. Kindly refer to this link for suggested solutions. Hope this helps!

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2020년 7월 24일

답변:

2020년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by