How do I create a Matlab 10x10 matrix of numbers 1-100?

How do I create a Matlab 10x10 matrix that contains the numbers 1-100 in column major form? I am not allowed to use the colon operator more than four times.

 Respuesta aceptada

Raza Ali
Raza Ali el 23 de Feb. de 2014
A=reshape(1:100,10,10)
or
A=reshape(1:100,10,10)'

2 comentarios

Matlab12
Matlab12 el 23 de Feb. de 2014
Much thanks Raza!
Sabrina
Sabrina el 23 de Jun. de 2017
Thanks! It helped me too.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Feb. de 2014

Comentada:

el 23 de Jun. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by