フィルターのクリア

Table "Vertical Lookup", how to do it?

3 ビュー (過去 30 日間)
Leonardo Urbano
Leonardo Urbano 2015 年 4 月 6 日
回答済み: Leonardo Urbano 2015 年 4 月 7 日
Hi everybody,
I'm asking you help to discriminate a table according a precise criteria, I'm better explaining:
- I have 2 different tables got from Google Finance, one different in length to the other (i.e. a is the longer and b is the shorter). I want to make the discrimination according to the "Date" field;
- I want to looking for each value of b in a and create a matrix C with all rows of common values (e.g. if the value of the discriminant column (the Date column) is in common, then take all the row of a and copy in C, for each common value);
I have already tried to set a for statement up with a if statement within it, but my matter is that the two discriminant columns are not in the same order (one has only business days while other has all days, so 365 vs. ~250) and I can't tell Matlab to do some similar to the Vertical Lookup in Excel.
I hope to has been clear enough!
Thanks in advance to everyone
Leo
  1 件のコメント
Thorsten
Thorsten 2015 年 4 月 7 日
It would be helpful if you provide the tables.

サインインしてコメントする。

採用された回答

Mohammad Abouali
Mohammad Abouali 2015 年 4 月 7 日
Look up join() and outerjoin() commands.

その他の回答 (2 件)

Peter Perkins
Peter Perkins 2015 年 4 月 7 日
編集済み: Peter Perkins 2015 年 4 月 7 日
It's not terrible clear what you're asking for. A simple example would have helped.
It sounds like you want to do a join operation. Consider putting your data into two MATLAB tables, and using the JOIN method.

Leonardo Urbano
Leonardo Urbano 2015 年 4 月 7 日
Thank you for replies!
I have solved making few steps more but building a more generic for statement based on the function busdays() and cutting off all unneeded data.
Thank you again!
Leo

カテゴリ

Help Center および File ExchangeFinancial Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by