MATLAB: Best way to store “collection” of time series; issues with “execute” on structure array

best way to store "collection" of time series; issues with "execute" on structure arrayFinancial Time Series ToolboxFinancial Toolboxoop

Hi,
I am trying to create a structure array or other aggregate object of time series objects (a "collection"). The idea is to have a dataset fully encapsulated by this large object. I will have multiple stocks in each time series, and each time series will have a name, like "average_price" for example.
I am writing a script that takes an excel file with one variable per sheet (and many stocks per sheet). For convenience, I name each of the sheets with the name of each variable. I want to use these sheet names as my variable names.
The "importdata" function works well to get all the data I need. However, to extract data after using importdata, I need to use fieldnames originating from excel (i.e. variable names). I can get these into a text variable, but then in order to access the data, I must do it with this text variable (not knowing the actual text itself). This is where I run into a problem. I have tried "execute" and "eval" with a concatenated string, but get this error "Undefined function 'execute' for input arguments of type 'cell'."
Perhaps I am going about it the wrong way, but my idea is to have a collection of times series, where I can call a variable such as daily.average_price and the result is a time series object for average price (with many stocks in that single object). The alternative is to have many different time series variables floating around, but I will have so many I am worried about getting confused as to what was updated when, etc.
I would appreciate any help. Also, any help as to what data structure is best to store these time series. THANKS!
Mike

Best Answer

"[...] text variable, but then in order to access the data, I must do it with this text variable [...]" . See containers.Map class
Related Question