home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / softsys / matlab / 208 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.1 KB

  1. 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
  2. From: phantom@stein2.u.washington.edu (The Phantom)
  3. Newsgroups: comp.soft-sys.matlab
  4. Subject: Re: Combining vectors
  5. Date: 27 Jan 1993 08:34:42 GMT
  6. Organization: University of Washington, Seattle
  7. Lines: 23
  8. Message-ID: <1k5hf2INNlgs@shelley.u.washington.edu>
  9. References: <1993Jan26.182616.11550@vax.oxford.ac.uk>
  10. NNTP-Posting-Host: stein2.u.washington.edu
  11.  
  12. In article <1993Jan26.182616.11550@vax.oxford.ac.uk> reese@vax.oxford.ac.uk writes:
  13. >
  14. >
  15. >I want to take two vectors and combine them, e.g.
  16. >[ a b c d e]  and [ f g h i j ] 
  17. >become  [ a f b g c h d i e j ]
  18. >
  19.  
  20. say a=[ a b c d e ] and b=[ f g h i j ] -- an easy way to do this would be
  21. using ...
  22.  
  23. len=length(a);            %assuming length(a), length(b) are equal
  24. FOR count=1:len,
  25.     c((count*2)-1)=a(count);
  26.     c((count*2)=b(count);
  27. END
  28.  
  29. that seems to work, anyway. just work with the commands for picking out 
  30. certain matrix spots and FOR loops, and you should be able to comprise 
  31. something that works both ways.
  32.  
  33. mt
  34.  
  35.