From: Jan Simon on
Dear Jose!

> noise = 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1
>
> round(length(noise)/3)=9
> x=reshape(noise(1:27),9,[])
> x =
>
> 1 1 0
> 1 1 0
> 1 1 0
> 1 0 1
> 0 0 1
> 0 0 1
> 0 1 1
> 1 1 1
> 1 1 1
>
> But the problem is that i am interested in this vector:
>
> x' =111
> 100
> 011
> 111
> 000
> 111
> 000
> 111
> 111

Do you search this:
x = transpose(reshape(noise(1:27), 3, 9))
?

Jan
From: Jose on
jrenfree <jrenfree(a)gmail.com> wrote in message <63904174-f79e-47b6-aa47-562755f21299(a)v12g2000prb.googlegroups.com>...
> On Jun 11, 2:09 pm, "Jose " <jose.l.v...(a)gmail.com> wrote:
> > Hello to everyone, i have got this vector and i want to split it in blocks 0f 3 elements:
> >
> > noise = 1     1     1     1     0     0     0     1     1     1     1     1     0     0     0     1     1     1     0     0     0     1     1     1     1     1     1     1
> >
> > round(length(noise)/3)=9
> >
> >  x=reshape(noise(1:27),9,[])
> >
> > x =
> >
> >      1     1     0
> >      1     1     0
> >      1     1     0
> >      1     0     1
> >      0     0     1
> >      0     0     1
> >      0     1     1
> >      1     1     1
> >      1     1     1
> >
> > But the problem is that i am interested in this vector:
> >
> > x' =111
> >       100
> >       011
> >       111
> >       000
> >        111
> >        000
> >        111
> >        111
> >
> > How can transform x in x'?
> >
> > Thanks in advance.
>
> This seems to do it:
>
> reshape(noise(1:27), 3, [])'


Thanks!!