Table to Matrix from SQL Query

2 次查看(过去 30 天)
Brian
Brian 2015-9-23
Hi, I have a large SQL query that is importing data into my workspace. I intend to create a data matrix and accompanying label vectors from this dataset to speed up processing.
My data comes in the following format via SQL (database toolbox) Cell Col1 = MktDate (format 'yyyy-mm-dd') Col2 = Identifier (format = char) Col3 = FactorName (format = char) Col4 = FactorValue (format = double)
I'm looking for a computationally efficient way to come up with an indexing method to create a matrix in this format. FactorValue matrix (data split out by factor in different columns and by date and Identifier down the rows) FactorName across the columns MktDate and Identifier down the rows.
My end product should be a matrix of factor values with a Nx1 vector of MktDates, an Nx1 vector of Identifiers and a 1xN cell of Factor Names.
I have done something similar using the unique command when I only have 1 variable to consider on each axis but never with 2 on one axis. Thanks in advance for your assistance. Brian

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by