Create a 3D Martix by operation of 1D vector on 2D matrix, using cat()
Mostrar comentarios más antiguos
Given a 2D matrix A, and a 1D vector B, I would like to create a 3D Martix, with 2D slices of A minus each element of B.
So for a B of length 4, this works:
cat(3, A-B(1), A-B(2), A-B(3), A-B(4)))
The actual dimensions will be around A(40000,7), B(150), so I need to be able to do this for a given size of B
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!