How do I make a 10 x 10 matrix variable with the numbers 1 to 100, in both column and row major forms?
Mostrar comentarios más antiguos
So I know how to make a row vector of numbers 1 to 100, x=[1:100], but how do I make it so that it's organized into column major form, split into 10 separate columns of 1 to 10, 11 to 20 ... 91 to 100? How would I do it for row major form? I want to do this with x as my only variable.
Edit: I also want to avoid using reshape.
Respuesta aceptada
Más respuestas (1)
Guoliang Zhang
el 29 de Sept. de 2014
0 votos
help reshape
a = [1:100];
b = reshape(a, [10,10])
will do.
2 comentarios
Rich Gar
el 29 de Sept. de 2014
Sean de Wolski
el 30 de Sept. de 2014
Why would you want to do that?
Categorías
Más información sobre Creating and Concatenating Matrices 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!