On Jun 24, 3:57 pm, "Diego Lass" <dlISC...@gmail.com> wrote:
> OK, so the question is
> I want to do ttest2 with two sets of vectors, but I don't want to test every single pair (testing is expansive). I only need to test certain pair. I know how to select the pair know. However, I want the whole list of the pairs. not just the ones I test. ttest2 will only give the pairs I tested, so I have to insert 0 for the pairs I didn't test. How do I insert the zeros?
> Thanks
> Diego
>
> Nathan <ngrec...@gmail.com> wrote in message <640c3b3bcdf840bebf4fc6d4491af...@i4g2000prm.googlegroups.com>...
> > On Jun 24, 3:37?pm, "Diego Lass" <dlISC...@gmail.com> wrote:
> > > Hi
> > > I would like to insert values into a vector with the location of insertion known, how do I insert them.
> > > For example,
> > > A = [2 ; 2; 3; 4]
> > > A = 2
> > > ? ? ? 2
> > > ? ? ? 3
> > > ? ? ? 4 ?
>
> > > I want to insert 0 every 1 element(variable, can change) i.e
> > > B = 2
> > > ? ? ? 0
> > > ? ? ? 2
> > > ? ? ? 0
> > > ? ? ? 3
> > > ? ? ? 0
> > > ? ? ? 4
> > > ? ? ? 0
>
> > > Thanks
> > > Diego
>
> > This is the third discussion regarding the same vague topic you have
> > made in a row. Why not come out and ask the whole question so people
> > can answer it to your specifications?
> > Thanks
> > Nathan
Well, do a repmat, set to zeros, then reshape?
A = [2;2;3;4];
A = repmat(A',2,1);
A(2,:) = 0;
B = reshape(A,1,[]);
Something like this?
