Reputation: 11
How can I create an array with number from 1 to 10 for example without repeating. Because I will use it to re-aling a matrix's rows. For example of 1 to 10, I want my output as: 4 1 3 8 2 5 6 7 9 10 But I don't want to have repated numbers. How can I do that?
Upvotes: 0
Views: 49
Reputation: 176
You can also use A = magic(4); B = A(A<=10); B will give you required matrix.
Upvotes: 0