Using the outerjoin to join more than 2 tables
    18 次查看(过去 30 天)
  
       显示 更早的评论
    
I want to join multiple tables together to make one table. I've used the outerjoin function to join 2 tables together(shown below). Is there anyway to join more than 2 tables using the outerjoin function.
c = outerjoin(data{1,1},data{1,3},'Keys','time','MergeKeys',true);
2 个评论
回答(1 个)
  Jan
      
      
 2018-1-30
        
      编辑:Jan
      
      
 2018-6-8
  
      You can nest the joining:
outerjoin(A, outerjoin(B, C))
[EDITED] With a loop:
function Joined = MultiOuterJoin(varargin)
Joined = varargin{1};
for k = 2:nargin
  Joined = outerjoin(Joined, varargin{k});
end
end
3 个评论
  Devin kIM
 2020-11-9
				I gotta agree with Nick on this one... This can be done in virtually all analysis languages, why is joining multiple tables not available in 2020b?  Seems like something that should have been available a long time ago instead of adding more flashy features...
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!