Add 2d array in a 3d array

20 vues (au cours des 30 derniers jours)
Alan De maman
Alan De maman le 6 Nov 2020
Commenté : Alan De maman le 6 Nov 2020
I have a matrix A = rand(10,5,10) and a matrix B = rand(10,10) and i would like to concatenate then along the second axis into a matrix C of shape (10,6,10)
  2 commentaires
Sindar
Sindar le 6 Nov 2020
try:
C = A;
C(:,6,:) = B;
Alan De maman
Alan De maman le 6 Nov 2020
Thank you Sindar, it worked as expected.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices 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!

Translated by