Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!ecngs!feeder2.ecngs.de!zen.net.uk!hamilton.zen.co.uk!feed4.jnfs.ja.net!jnfs.ja.net!gemini.csx.cam.ac.uk!news.cam.ac.uk!tpl
From: tpl@eng.cam.ac.uk (Tim Love)
Newsgroups: comp.soft-sys.matlab
Subject: Re: even indexed elements of certain vector
Date: 16 Oct 2009 15:33:19 GMT
Organization: University of Cambridge, England
Lines: 7
Message-ID: <hba3nv$hcq$1@gemini.csx.cam.ac.uk>
References: <hba3cm$18k$1@fred.mathworks.com>
NNTP-Posting-Host: last.eng.cam.ac.uk
Xref: news.mathworks.com comp.soft-sys.matlab:577872


"Tim Lee" <lilp0ison@hotmail.com> writes:

>Given a row vector VecR by any length, produce another row vector VecR2 given by the even indexed elements of VecR followed by the odd indexed element of VecR

>I know how to create a row vector, but I have no idea how i should seperate the even and odd indexed elements.

You could try it using "for" loops couldn't you? Might not be the fastest way, but it's worth a try.