For Programmers: Free Programming Magazines  


Home > Archive > Matlab > August 2007 > pivot table in matlab









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author pivot table in matlab
Peter

2007-08-23, 7:19 pm

Hi, i'd like to do a simple pivot table like the one excel
does in matlab. basically, I have row based data (e.g. date,
city,# of car accidents) and would like to move it into a
column based format (rows=dates,
columns=city,matrix-element=#of car accidents). Is there a
good way to do this in matlab?

Example:
jan-2000 | Boston | 200
jan-2000 | new York | 500
jan-2000 | Miami | 300
Feb-2000 | Boston | 300
Feb-2000 | Miami | 200
Mar-2000 | Boston | 300
Mar-2000 | New York | 200

=>

Date | Boston | New York | Miami
jan-2000 | 200 | 500 | 300
feb-2000 | 300 | | 200
mar-2000 | 300 | 200 |

Thanks for your help!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com