home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ftpbox!news.acns.nwu.edu!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!ames!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!stein2.u.washington.edu!phantom
- From: phantom@stein2.u.washington.edu (The Phantom)
- Newsgroups: comp.soft-sys.matlab
- Subject: Re: Combining vectors
- Date: 27 Jan 1993 08:34:42 GMT
- Organization: University of Washington, Seattle
- Lines: 23
- Message-ID: <1k5hf2INNlgs@shelley.u.washington.edu>
- References: <1993Jan26.182616.11550@vax.oxford.ac.uk>
- NNTP-Posting-Host: stein2.u.washington.edu
-
- In article <1993Jan26.182616.11550@vax.oxford.ac.uk> reese@vax.oxford.ac.uk writes:
- >
- >
- >I want to take two vectors and combine them, e.g.
- >[ a b c d e] and [ f g h i j ]
- >become [ a f b g c h d i e j ]
- >
-
- say a=[ a b c d e ] and b=[ f g h i j ] -- an easy way to do this would be
- using ...
-
- len=length(a); %assuming length(a), length(b) are equal
- FOR count=1:len,
- c((count*2)-1)=a(count);
- c((count*2)=b(count);
- END
-
- that seems to work, anyway. just work with the commands for picking out
- certain matrix spots and FOR loops, and you should be able to comprise
- something that works both ways.
-
- mt
-
-