forループを用いた場合のテーブルの結合

조회 수: 12 (최근 30일)
碧海 吉川
碧海 吉川 2020년 8월 24일
답변: madhan ravi 2020년 8월 24일
forループ内で作成した次元の同じテーブルをすべて結合して1つのテーブルにするにはどうすればよいでしょうか。
ループ内で作成するテーブルはそれぞれ2000行1列のもので、ループの回数を列にして結合したく思っております。

답변 (1개)

madhan ravi
madhan ravi 2020년 8월 24일
c = cell(2, 1); % 2 represents no of tables
for k = 1:numel(c)
c{k} = table(rand(10, 1), 'VariableNames', {sprintf('N%d', k)});
end
[c{:}] % an example to horizontaly concatenate tables created in a loop

카테고리

Help CenterFile Exchange에서 ループと条件付きステートメント에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!