Union of dates keeping associated data aligned

2 views (last 30 days)
I am pulling in BB data for a number of indices; prices and dates.
I would like to create the unique list of dates (union) but keep the index prices for the unique dates aligned to their prices i.e. I only want index prices when all indices have a valid price published.

Answers (1)

the cyclist
the cyclist on 19 Jan 2012
I don't fully understand what you want, but I think you can do it with the unique() command. If you call unique() like this:
[uniqueX, indexToUniqueX, indexFromUniqueXBackToAll] = unique(X)
then I expect that the 2nd and 3rd arguments will help you do what you need in terms of tracking unique dates/prices. A careful read of "doc unique" will probably get you there.

Tags

Community Treasure Hunt

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

Start Hunting!