필터 지우기
필터 지우기

Join or Merge Data

조회 수: 2 (최근 30일)
Brian
Brian 2014년 7월 9일
편집: per isakson 2014년 7월 12일
Hi, I have two large cells that I need to effectively "JOIN" together via two fields (one text and one numeric). Say one cell has 3 fields ID1(text),Date1(numeric),DataElement1(numeric). Say the second cell has 3 fields ID2, Date2, DataElement2. I need to have a third cell with a left outer join from cell1->cell2 on Id1->Id2 and Date1->Date2. This effectively will return me cell number one with an additional column (DataElement2).
What is the most effective way to go about doing this? Would it be turning the cell's into data-sets and performing the join function? I can easily write a loop to go one security at a time but because of the nature of text search functions (strcmp) this is incredibly slow when I have a million records or so to perform the search on.
Any suggestions would be much appreciated - thanks! Brian
  댓글 수: 1
Brian
Brian 2014년 7월 9일
편집: Brian 2014년 7월 9일
I tested the dataset JOIN function with test data that was roughly 100,000 rows long. Matlab jumped to using 40GB of ram (of the 48 on my machine) and my entire system has crawled to a hault. In other words, unless someone can see an error in my join code, I might need to explore something different.
Where -
ds1 = dataset(Date1,ID1,DataElement1)
ds2 = dataset(Date2,ID2,DataElement2)
ds3 = join(ds1,ds2,'type','leftouter','LeftKeys',{'Date1' 'ID1'},'RightKeys',{'Date2' 'ID2'},'mergekeys',true);

댓글을 달려면 로그인하십시오.

채택된 답변

per isakson
per isakson 2014년 7월 12일
편집: per isakson 2014년 7월 12일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by