I'm receiving a very large quantity of data in a table like format with only 3 columns (Ticker, Return, Date). What I end up with are thousands of instances of the same date and ticker which becomes very inefficient for Matlab to utilize in calculations. I'd like a matrix with Tickers across the columns and dates down the rows. The trick is that not all tickers have a Return for every date so I can't just reshape the matrix based on a unique count of tickers and dates. Does anyone have any idea how to go about doing this? Here's an example of what I'm looking for.
Initial Format
IBM,1.01,1IBM,1.04,2IBM,1.06,3GOOG,.99,1GOOG,.98,2AAPL,1,1AAPL,1.1,2AAPL,.99,3
Matrix Format below. Where Dates and Tickers would likely be separate arrays. This example should copy to Excel and make it more clear
,AAPL,GOOG,IBM1,1,99,1.012,1.1,.98,1.043,.99,Nan,1.06
Best Answer