Dividing a vector into a matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Colt Davis
el 19 de Mzo. de 2015
Editada: Andrei Bobrov
el 20 de Mzo. de 2015
I have a vector that has 40755 entries. I need to make this a multidimensional matrix where a new row is started every sixteenth entry. Any ideas? ex)
vector = [1,2,3,4,5,6,7,8,9,10,11,12]
split this up every third element
matrix [1,2,3
4,5,6
7,8,9,
10,11,12]
0 comentarios
Respuesta aceptada
Star Strider
el 20 de Mzo. de 2015
I have no idea what shape you want your result matrix to be (it’s not clear from your question), so I can’t provide specific code. (The length of your vector is not evenly divisible by (12*16), so you have to be more specific with respect to what you want reshape to produce.)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Resizing and Reshaping 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!