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

forループ内で作成した次元の同じテーブルをすべて結合して1つのテーブルにするにはどうすればよいでしょうか。
ループ内で作成するテーブルはそれぞれ2000行1列のもので、ループの回数を列にして結合したく思っております。

Respuestas (1)

madhan ravi
madhan ravi el 24 de Ag. de 2020

1 voto

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

Categorías

Más información sobre ループと条件付きステートメント en Centro de ayuda y File Exchange.

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 24 de Ag. de 2020

Respondida:

el 24 de Ag. de 2020

Community Treasure Hunt

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

Start Hunting!