Pivot/unPivot

版本 1.2.0.0 (73.7 KB) 作者: Oleg Komarov
Group a flat dataset into pivot table and unpivot it back
1.9K 次下载
更新时间 2010/2/5

查看许可证

These two functions are meant to format a flat dataset into a pivot table and to unpivot it back.
They imitate the T_SQL pivot/unpivot commands or the pivoting functionalities of the spreadsheet softwares.

If you a have a large set of values which are described by two features (or more) this function allows you to group those values by those two features.

For example, you can sum to the total amount sold over the last 10 months by any of your employees or you can count the number of contracts signed by region and by salesmen and so on...

For detailed help and description see the published M-file or the help of the functions.

For examples see the attached snapshot.

Comments/suggestions/error reports are welcome.

Thanks to Jos (10584) for cell2float.

p4v3

引用格式

Oleg Komarov (2024). Pivot/unPivot (https://www.mathworks.com/matlabcentral/fileexchange/26119-pivot-unpivot), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Tables 的更多信息
致谢

参考作品: CELL2FLOAT

启发作品: mat2piv.m

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.2.0.0

unPivot: fixed column position in Out (the first was switched with the second)

1.1.0.0

Corrected syntax for compatibility; edited description; added link to the submission

1.0.0.0