Re: Re: Package to 'graft' Lists onto Matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg87798] Re: [mg87739] Re: Package to 'graft' Lists onto Matrices
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Thu, 17 Apr 2008 06:57:26 -0400 (EDT)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200804160906.FAA24077@smc.vnet.net>
- Reply-to: murray at math.umass.edu
Yes, that works. Indeed, it was exactly the sort of thing I got used to doing years ago with the array-processing language APL (but no longer had to do once Ken Iverson invented the idea of rank of a "verb"). Still, the method seems "excessive" and perhaps even "sneaky" to me -- transposing twice. And it might be rather inefficient as the matrix size grows (although I haven't tested timings). Bill Rowe wrote: > > In[19]:= m = Partition[Range[9], 3]; > > ... if I wanted to add a column I could do > > In[22]:= Transpose@Join[Transpose@m, {data}] > > Out[22]= {{1, 2, 3, 2}, {4, 5, 6, 0}, {7, 8, 9, 0}} -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Re: Package to 'graft' Lists onto Matrices
- From: Bill Rowe <readnews@sbcglobal.net>
- Re: Package to 'graft' Lists onto Matrices