From: Erik Andersson on
Hello!
I've would like to create a matrix 1000*3 i dimension which has all the combinations of the numbers 1 to 10 in it, i.e

1 1 1
1 1 2
.. . .
1 1 10
1 2 1
1 2 2
.. . .
1 2 10
1 3 1
And so on...

Someone?
From: Sean on
"Erik Andersson" <annerk02(a)student.umu.se> wrote in message <hrrnnq$mpa$1(a)fred.mathworks.com>...
> Hello!
> I've would like to create a matrix 1000*3 i dimension which has all the combinations of the numbers 1 to 10 in it, i.e
>
> 1 1 1
> 1 1 2
> . . .
> 1 1 10
> 1 2 1
> 1 2 2
> . . .
> 1 2 10
> 1 3 1
> And so on...
>
> Someone?

One way:
>>special_matrix = [ones(1000,1),sort(repmat([1:10]',100,1)) ,repmat([1:10]',100,1)];
From: Sean on
"Sean " <sean.dewolski(a)nospamplease.umit.maine.edu> wrote in message <hrrrlc$cjo$1(a)fred.mathworks.com>...
> "Erik Andersson" <annerk02(a)student.umu.se> wrote in message <hrrnnq$mpa$1(a)fred.mathworks.com>...
> > Hello!
> > I've would like to create a matrix 1000*3 i dimension which has all the combinations of the numbers 1 to 10 in it, i.e
> >
> > 1 1 1
> > 1 1 2
> > . . .
> > 1 1 10
> > 1 2 1
> > 1 2 2
> > . . .
> > 1 2 10
> > 1 3 1
> > And so on...
> >
> > Someone?
>
> One way:
> >>special_matrix = [ones(1000,1),sort(repmat([1:10]',100,1)) ,repmat([1:10]',100,1)];

That was wrong :(

I meant this:
special_matrix = [sort(repmat([1:10]',100,1)), repmat(sort(repmat([1:10]',10,1)),10,1) ,repmat([1:10]',100,1)];
From: Matt J on
"Erik Andersson" <annerk02(a)student.umu.se> wrote in message <hrrnnq$mpa$1(a)fred.mathworks.com>...
> Hello!
> I've would like to create a matrix 1000*3 i dimension which has all the combinations of the numbers 1 to 10 in it, i.e
======================


[c3,c2,c1]=ndgrid(1:10,1:10,1:10);
special_matrix=[c1(:),c2(:),c3(:)];