Skip to content
Snippets Groups Projects
Commit d6472c63 authored by William Lövfors's avatar William Lövfors
Browse files

Created ConcatenateTableColumns

parent 5059f614
No related branches found
No related tags found
No related merge requests found
function [t]=ConcatenateTableColums(t1,t2)
% FUNCTION [t]=CONCATENATETABLECOLUMNS(t1,t2)
%The fuction takes two tables, and combines them columnwise.
% Adds shared variables from t2 to t1. In practice, all columns in t2 which is also t1 is added.
% Any column not in t1 will be ignored.
t=t1;
for i = 1:length(t1.Properties.VariableNames)
var=t.Properties.VariableNames{i};
if any(ismember(t2.Properties.VariableNames,var))
t.(var)=[t1.(var) t2.(var)];
end
end
end
\ No newline at end of file
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment