Concatenate layered matrix into one layer

4 visualizaciones (últimos 30 días)
Andrew Poissant
Andrew Poissant el 12 de Jul. de 2018
Comentada: OCDER el 12 de Jul. de 2018
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.

Respuesta aceptada

OCDER
OCDER el 12 de Jul. de 2018
Editada: OCDER el 12 de Jul. de 2018
a = randi(10, 2, 133, 5);
b = reshape(a, size(a, 1), size(a, 2) * size(a, 3));
  2 comentarios
Andrew Poissant
Andrew Poissant el 12 de Jul. de 2018
Worked like a charm, thanks!
OCDER
OCDER el 12 de Jul. de 2018
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by