matlabtimetable

Creating array of timetables in MATLAB


I am attempting to do some analysis on a series of timetable objects. Each has a potentially different date range (they represent observations of a time series). I would like to pass this array of timetable objects into a function.

Using the quandl addon:

>> conn = quandl(<YOUR_API_KEY_HERE>);
>> z1 = history(conn, 'ZILLOW/M1300_MPPRSF');
>> z2 = history(conn, 'ZILLOW/M1300_MPPRAH');

Then attempting to take these two time series and group them into an array (NOT join them together):

>> [z1, z2]
Duplicate table variable name: 'Value'.

Is there a method to do this such that I could save a number of timetables into a vector so that I can iterate over them without using varargin in the function?

Thank you.


Solution

  • You cannot concatenate two timetables horizontally if the names of the variables are identical. I suggest you create a cell array of timetables and use that instead.

    >> {z1 z2} 
    

    You might find this doc page on datatypes useful.