Row major order matrix

11 visualizaciones (últimos 30 días)
Basem Sharafeldin
Basem Sharafeldin el 15 de Oct. de 2015
Editada: Andrei Bobrov el 16 de Oct. de 2015
Im trying to create a 11x11 matrix in column matrix order using numbers 1-121 but i cannot figure out how to do it. I'm trying to use the ones and zeros command and transpose and similar functions.

Respuestas (1)

Andrei Bobrov
Andrei Bobrov el 15 de Oct. de 2015
Editada: Andrei Bobrov el 16 de Oct. de 2015
out = bsxfun(@plus,1:11:111,(0:10)')
or
out = reshape(1:121,11,[]);
or
out = zeros(11);
out(:) = 1:121;
  1 comentario
Basem Sharafeldin
Basem Sharafeldin el 15 de Oct. de 2015
Editada: Basem Sharafeldin el 15 de Oct. de 2015
is there a way to do this using matrix commands such as transpose, zeros(), ones(), or other in that category?

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by