Xref: utzoo alt.sources.wanted:5 comp.sources.wanted:9344 comp.unix.questions:17530 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsfcgl!cca.ucsf.edu!root From: root@cca.ucsf.edu (Systems Staff) Newsgroups: alt.sources.wanted,comp.sources.wanted,comp.unix.questions Subject: Re: matrix invert routine Summary: Transpose, not invert Message-ID: <2560@ucsfcca.ucsf.edu> Date: 9 Nov 89 22:39:50 GMT References: <1612@xn.LL.MIT.EDU> Organization: Computer Center, UCSF Lines: 49 In article <1612@xn.LL.MIT.EDU>, rkc@XN.LL.MIT.EDU (rkc) writes: > I have "spreadsheet-like" data that looks like this: > a1 b1 c1 > a2 b2 c2 > a3 b3 c3 > and I want to get it in a form like: > a1 a2 a3 > b1 b2 b3 > c1 c2 c3 A small matter of terminology: This operation is transposing, not inverting. Inverting a matrix is analogous to taking the reciprocal of a scalar. Transposition would apply perfectly well to a matrix whose elements are not numeric. If your data is in the form of a multi-column text file you could do the transpose with standard Unix tools (I would look at awk first) but if it is in some internal form for a spreadsheet program I would look at the speadsheet first. Thos Sumner Internet: thos@cca.ucsf.edu (The I.G.) UUCP: ...ucbvax!ucsfcgl!cca.ucsf!thos BITNET: thos@ucsfcca U.S. Mail: Thos Sumner, Computer Center, Rm U-76, UCSF San Francisco, CA 94143-0704 USA I hear nothing in life is certain but death and taxes -- and they're working on death. #include Thos Sumner Internet: thos@cca.ucsf.edu (The I.G.) UUCP: ...ucbvax!ucsfcgl!cca.ucsf!thos BITNET: thos@ucsfcca U.S. Mail: Thos Sumner, Computer Center, Rm U-76, UCSF San Francisco, CA 94143-0704 USA I hear nothing in life is certain but death and taxes -- and they're working on death. #include