"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <hntltp$r3r$1@fred.mathworks.com>...
> Hi Everyone,
>
> In extension to a problem posted yesterday (Subject: Complicated vector operation!), I am having trouble with a perhaps even nastier version!
>
> Suppose I have a horizontal vector, "A". For example:
>
> A = [2 3 5 5 1 4]
>
> Suppose also that I have a vertical vector of integers:
>
> number_in_sample = [1 3 5]'
>
> Now I wish to create a vertical vector, called "averages", which consists of averages of numbers drawn from A, where the number of elements drawn (without replacement), is defined by the vector number_in_sample.
>
> So, the number of elements in "averages", is equal to the number of elements in "number_in_sample".
>
> Can this be done without the need to loop?
>
> I appreciate the help.
>
> Regards,
>
> Ulrik.
of course, no problem...
us
