MATLAB Answers

Tom
0

How do I create a (10,10) matrix containing numbers from 1 to 100?

Asked by Tom
on 18 Sep 2013
Latest activity Edited by SYED ABOU ILTAF HUSSAIN on 2 Sep 2018
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 Comments

Is this homework? What have you tried so far?
I did it using
ij = [1:10 ; 11:20 ; 21:30 ; 31:40 ; 41:50 ; 51:60 ; 61:70 ; 71:80 ; 81:90 ; 91:100]
but Walter's is better obviously. I'm just getting going on my Master's dissertation in Audio Acoustics.

Sign in to comment.

Products

2 Answers

Answer by Walter Roberson
on 18 Sep 2013
 Accepted Answer

reshape( 1:100, 10, 10) .'

  1 Comment

Many thanks Walter!

Sign in to comment.



Try this a= [1:10]; for i=2:10 a(i,:)=a(i-1,:)+10; end

  0 Comments

Sign in to comment.