Concatenate layered matrix into one layer

4 views (last 30 days)
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.

Accepted Answer

OCDER
OCDER on 12 Jul 2018
Edited: OCDER on 12 Jul 2018
a = randi(10, 2, 133, 5);
b = reshape(a, size(a, 1), size(a, 2) * size(a, 3));

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!