Table to Matrix from SQL Query

1 view (last 30 days)
Brian on 23 Sep 2015
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

Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by