Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!x1g2000prh.googlegroups.com!not-for-mail
From: Nathan <ngreco32@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Insert elements into the vector
Date: Wed, 24 Jun 2009 16:03:56 -0700 (PDT)
Organization: http://groups.google.com
Lines: 50
Message-ID: <4cf4f66f-e27b-44fc-be85-7becf6432eb1@x1g2000prh.googlegroups.com>
References: <h1u9qc$5o4$1@fred.mathworks.com> <640c3b3b-cdf8-40be-bf4f-c6d4491af598@i4g2000prm.googlegroups.com> 
	<h1uavt$jdi$1@fred.mathworks.com>
NNTP-Posting-Host: 198.206.219.33
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1245884636 20203 127.0.0.1 (24 Jun 2009 23:03:56 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 24 Jun 2009 23:03:56 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: x1g2000prh.googlegroups.com; posting-host=198.206.219.33; 
	posting-account=_KeVcAoAAAB7j3xn35ujaQ0BoQhuzwJP
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) 
	Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 wwwproxy-son-ca-01.ca.sandia.gov:80 (squid/2.5.STABLE14)
Xref: news.mathworks.com comp.soft-sys.matlab:550466


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 <640c3b3b-cdf8-40be-bf4f-c6d4491af...@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?