Sort and match data in a table

조회 수: 2 (최근 30일)
Julian
Julian 2019년 9월 10일
댓글: Julian 2019년 9월 10일
Hi,
i basically have a table with two collumns.
Col1 Col 2
Label1 9
Label2 8
Label3 6
Label1 5
Label2 5
To analyze this I want to have a table which is basically something like this.
Label 1 9 5
Label 2 8 5
Label 3 6
Then i want to export this to Excel. This is why i thought it would be best to work with tables. Also because in the code before I used a lot of findgroups and splitapply, thats why the format was pretty nice. But right now i'm really stuck. I think there should exist a fairly easy solution, but i don't really see it.

채택된 답변

Julian
Julian 2019년 9월 10일
You might consider
groupsummary(D, 'Col1', @(x){x})
where D is table containing your data. This does leave a "ragged right" cell array containing differing lengths and you will need to pad it if you want a uniform tabular representation.
  댓글 수: 1
Julian
Julian 2019년 9월 10일
Yes this worked just fine for me, thank you very much :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by