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

6 vues (au cours des 30 derniers jours)
Matlab12
Matlab12 le 23 Fév 2014
Commenté : Sabrina le 23 Juin 2017
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.

Réponse acceptée

Raza Ali
Raza Ali le 23 Fév 2014
A=reshape(1:100,10,10)
or
A=reshape(1:100,10,10)'
  2 commentaires
Matlab12
Matlab12 le 23 Fév 2014
Much thanks Raza!
Sabrina
Sabrina le 23 Juin 2017
Thanks! It helped me too.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by