How to reshape a matrix from a vector?
Mostrar comentarios más antiguos
I have a vector of 105 elements where the sizes are not compatible for a matrix. I want to make it a 2 dimensional matrix by adding zeros at last so that it becomes compatible for the matrix. Would you please tell me how can i do it?
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 14 de Oct. de 2014
Editada: Sean de Wolski
el 14 de Oct. de 2014
If you want a 100x2 from a 105 element vector, padding with zeros, this should do it:
buffer(1:105,100)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!