How do I create a (10,10) matrix containing numbers from 1 to 100?
199 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How do I create a (10,10) matrix containing numbers from 1 to 100?
I just want the numbers to go 1 to 10 on the top row, then 11-20 on the 2nd row etc.
2 Commenti
Risposta accettata
Più risposte (4)
Steven Lord
il 25 Gen 2022
Another solution using implicit expansion (which wasn't available back in 2013 when this question was posted):
n = 10;
A = (1:n) + n*(0:n-1).'
0 Commenti
SYED ABOU ILTAF HUSSAIN
il 2 Set 2018
Modificato: SYED ABOU ILTAF HUSSAIN
il 2 Set 2018
Try this a= [1:10]; for i=2:10 a(i,:)=a(i-1,:)+10; end
0 Commenti
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!