concatenate mutiple tables by repetative process

조회 수: 1 (최근 30일)
George
George 2013년 10월 16일
편집: Stephen23 2019년 10월 21일
Hello
I have a very large number of individual tables at my workspace, and I would like to concatenate them into a larger one by vertically combining all of them.
I have seen vertcat but i think it doesn't do so many repetition
The form of the final table is supposed to be =[A;B;...;n], does any body know of a way to automatically concatenate them.
regards
George

채택된 답변

Jos (10584)
Jos (10584) 2013년 10월 16일
How are these tables stored in your workspace? Do they all have an individual name (like Table1, MyOtherTable, B, DDDDD, ...)? Can you somehow generate these table differently, so they are all stored in a cell array or an array of structs? Then it would be easy, making use of comma-separated list expansion :
% cell array example
C{1} = rand(3,4) ;
C{2} = ones(2,4) ;
C{3} = zeros(4,4) ;
vertcat(C{:})
% structure array example
S(1).data = rand(2,3) ;
S(2).data = zeros(3,3) ;
S(3).data = ones(1,3) ;
vertcat(S.data)
  댓글 수: 1
George
George 2013년 10월 16일
편집: George 2013년 10월 16일
hi
the tables are generated into the workspace after some data manipulation of some .netCDF files, each table has been assigned a name automatically e.g. W1, W2.....Wn.
I had the tables into a structure (struct 1x1), but due to certain conditions had to individually extract them and save them assigning them with a timestamp, so now they are on the workspace as a table of 1603x561.
So all the tables are exactly the same dimension but my problem is how to automatically combine them vertically

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by