How to create a pivot table
古いコメントを表示
I have a table
date person spendings
----------------------------------------
1/1/2020 John $100
1/1/2020 Mike $50
1/2/2020 John $75
1/3/2020 Mike $40
I want to create a pivot table
John Spendings Mike Spendings
----------------------------------------------------------------------------------
January 2020
February 2020
March 2020
Please advise.
採用された回答
その他の回答 (1 件)
Lola Davidson
2023 年 3 月 17 日
1 投票
As of R2023a, you can use the "pivot" function: https://www.mathworks.com/help/matlab/ref/pivot.html
Tout = pivot(Tin, Rows="date", RowsBinMethod="month", Columns="person", DataVariable="spendings");
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!