Add 2d array in a 3d array

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 Commenti

try:
C = A;
C(:,6,:) = B;
Thank you Sindar, it worked as expected.

Accedi per commentare.

Risposte (0)

Categorie

Richiesto:

il 6 Nov 2020

Commentato:

il 6 Nov 2020

Community Treasure Hunt

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

Start Hunting!

Translated by