Add 2d array in a 3d array

조회 수: 20 (최근 30일)
Alan De maman
Alan De maman 2020년 11월 6일
댓글: Alan De maman 2020년 11월 6일
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
Sindar
Sindar 2020년 11월 6일
try:
C = A;
C(:,6,:) = B;
Alan De maman
Alan De maman 2020년 11월 6일
Thank you Sindar, it worked as expected.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by