How to add 2 or 3 tables in column wise ?

1 次查看(过去 30 天)
I got four tables of size 50*1, how can I add them column wise so that i can get 200*1 table ?

采纳的回答

Chunru
Chunru 2021-8-5
% for array
a = randn(5,1); b = randn(5,1); c = randn(5, 1); d = randn(5,1); % 5->50
x = [a; b; c; d]
x = 20×1
-0.5414 1.0003 0.7572 -0.5802 -0.6630 -0.5653 1.2107 -0.2414 -0.8935 0.1998

更多回答(1 个)

Awais Saeed
Awais Saeed 2021-8-5
% create four matrices of size 50*1
A = zeros(50,1);
B = ones(50,1);
C = zeros(50,1);
D = ones(50,1);
% arrange them column-wise
new_mat = [A;B;C;D];
You can also use vertcat
vertcat(vertcat(vertcat(A,B),C),D);

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by