Create Unit-Spaced Matrix
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Philipp Kutschmann
le 17 Sep 2022
Réponse apportée : Walter Roberson
le 17 Sep 2022
Hi,
is there a better way to create a simple array of acsending numbers than:
foo = reshape(1:9,3,3)
Thanks
0 commentaires
Réponse acceptée
Walter Roberson
le 17 Sep 2022
No, that is the best available -- unless you want to count
foo = reshape(1:9,3,[]) %3 rows, as many colums as needed.
If you have the Computer Communications Toolbox, you can use
foo = buffer(1:9, 3) %3 rows
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Types dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!