Concatenate layered matrix into one layer

조회 수: 1 (최근 30일)
Andrew Poissant
Andrew Poissant 2018년 7월 12일
댓글: OCDER 2018년 7월 12일
I have a 2x133xi layered matrix. How can I take the i layers and combine it into a single layer matrix? So if i = 5 and I had a 2x133x5 matrix, the end result would be just a 2x665? I tried using the cat function but I can't seem to automate it for any number i.

채택된 답변

OCDER
OCDER 2018년 7월 12일
편집: OCDER 2018년 7월 12일
a = randi(10, 2, 133, 5);
b = reshape(a, size(a, 1), size(a, 2) * size(a, 3));
  댓글 수: 2
Andrew Poissant
Andrew Poissant 2018년 7월 12일
Worked like a charm, thanks!
OCDER
OCDER 2018년 7월 12일
You're welcome!

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

추가 답변 (0개)

카테고리

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