Merging three table data or array data in column wise in alternative sequence
이전 댓글 표시
I have three tables like mentioned below
Table A Table B Table C
0 A1 A2 A3 0 B1 B2 B3 0 C1 C2 C3
10 A1 A2 A3 10 B1 B2 B3 10 C1 C2 C3
20 A1 A2 A3 20 B1 B2 B3 20 C1 C2 C3
30 A1 A2 A3 30 B1 B2 B3 30 C1 C2 C3
40 A1 A2 A3 40 B1 B2 B3 40 C1 C2 C3
Combined Table ABC in alternative way column wise
0 A1 B1 C1 A2 B2 C2 A3 B3 C3
10 A1 B1 C1 A2 B2 C2 A3 B3 C3
20 A1 B1 C1 A2 B2 C2 A3 B3 C3
30 A1 B1 C1 A2 B2 C2 A3 B3 C3
40 A1 B1 C1 A2 B2 C2 A3 B3 C3
i need to perform this process in loop to merge 400+ data column.
test1=array2table(hs_coeff');
test2=array2table(ms_coeff');
test3=array2table(ls_coeff');
testtable = table(test1.Var1,test2.Var1,test3.Var1);
the above is my code need to loop the testtable to 434 time to merger 434 column of each table test1, test2 and test3
i also tried with array itself like mentioned below
for i=1:434
testtable = [hs_coeff(i,:);ms_coeff(i,:);ls_coeff(i,:)];
end
댓글 수: 4
Mohammed Hablullah
2019년 12월 10일
Mohammed Hablullah
2019년 12월 10일
편집: Mohammed Hablullah
2019년 12월 11일
This line should be throwing an error since your table's variable names are the same between the tables. But you wrote that you're getting a result. So, either the variable names are different from what you reported or you're changing them somewhere. We can't concatenate tables with duplicate headers.
testtable1(:,i) = [test1(:,i); test2(:,i); test3(:,i)];
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!