0

I have an Excel file containing the time series of some financial variables, let's call them X and Y, computed at the same dates.

These variables are computed for four different universes of funds, let's say A,B,C and D, which are all made of 6K funds.

I have started using for each universe a structure made of two tables, one for X and one for Y, containing the time series stored horizzontally. For example, table X of universe A has as Row Names the names of funds in A and as Variable Names the dates at which X is computed.

My problem is that the data type Table doesn't allow to have same column headers as Variable Names must be uniques. Instead I would like to have same column headers both among different tables from the same universe (A.X and A.Y) and among different tables from different universes (A.X and B.Y).

Does anyone know a way to bypass the unicity constraint? I would really like to use the structures of tables architecture as it allows me to name variables and acces them easily.

Thanks for your help.

Francesca
  • 13
  • 2

1 Answers1

0

since dates are same and unique, why don't you make them the row names and let the Universe.Fund.{X,Y} be your column names. In fact you don't need Rownames at all... I.e. have the first column be 'RecordDate' and the rest be your time-series

If you want the convenience of using names you can still use them, but you will just be getting the columns instead of the rows as such:

T.('column_name') or T.column_name

http://se.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html?refresh=true

alexandre iolov
  • 582
  • 3
  • 11
  • Unfortunately this didn't work for me. I tried to create a table of 5k columns and that worked fine, but when I added the remaining 1k columns the table became an empty structure. I found it quite puzzling but I guess it happens because of the size of my universes. Indeed I explicitly said that each of them is made of 6k elements because of this constraint. – Francesca Mar 30 '15 at 14:10
  • Are you sure it was empty? What happens if you try to acces the 6000 th column as such 'T(:, 6000)'? I think what bails is the data viewer, the data is still there... – alexandre iolov Mar 30 '15 at 14:14