How to add 2 or 3 tables in column wise ?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Badavath Purnesh Singh
le 5 Août 2021
Commenté : Badavath Purnesh Singh
le 5 Août 2021
I got four tables of size 50*1, how can I add them column wise so that i can get 200*1 table ?
0 commentaires
Réponse acceptée
Chunru
le 5 Août 2021
% 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]
Plus de réponses (1)
Awais Saeed
le 5 Août 2021
% 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);
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!