"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <i4m3ug$d9h$1@fred.mathworks.com>...
> "smith Og" <adeog@ymail.com> wrote in message <i4m3dn$8rq$1@fred.mathworks.com>...
> > Hi,
> >
> > I have vectors/scalars of x and y , and I want to combine them , I will give three examples. In any case, I want a combination of x and y.
> >
> > example 1:
> > y = [y1 y2]
> > x = [x1 x2 x3]
> >
> > Answer:
> > x1 y1
> > x2 y1
> > x3 y1
> > x1 y2
> > x2 y2
> > x3 y2
> >
> > example 2:
> > y = y1
> > x = [x1 x2 x3]
> >
> > Answer:
> > x1 y1
> > x2 y1
> > x3 y3
> >
> > example 3:
> > y = [y1 y2 y3]
> > x = [x1 x2 x3]
> >
> > Answer:
> > x1 y1
> > x2 y1
> > x3 y1
> > x1 y2
> > x2 y2
> > x3 y2
> > x1 y3
> > x2 y3
> > x3 y3
> >
> > Note that x,and y can have any number of vectors. I have tried using built in function but no success. Any hint is okay.
>
> You mean this:
> [xx yy ]= meshgrid(1:3,4:6)
> [xx(:),yy(:)]
Very correct.
Thanks Sean, Steven
