Re: Transpose matrix does not work when MatrixForm is used, why?
- To: mathgroup at smc.vnet.net
- Subject: [mg45411] Re: Transpose matrix does not work when MatrixForm is used, why?
- From: Dr Bob <drbob at bigfoot.com>
- Date: Tue, 6 Jan 2004 04:17:29 -0500 (EST)
- References: <001901c3d3c0$c95cf580$6401a8c0@bcolletti>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
This is related to an ongoing thread on computing Transpose (and other functions) of MatrixForm objects. There should be a better answer, but here's one in the meantime: data = Array[{# + Random[], # - Random[]} &, {100}]; z = Regress[data, {1, x, x^2}, x, RegressionReport -> CovarianceMatrix] X = CovarianceMatrix /. (z /. MatrixForm -> Identity) X[[2, 2]] This also works, but NOT when Ted Ersek's suggested fix for MatrixForm is installed: X = CovarianceMatrix /. z /. MatrixForm -> Identity Bobby "Bruce W. Colletti" <bcolletti at compuserve.com> wrote in message news:<btb8oi$jp4$1 at smc.vnet.net>... > Re Mathematica 5.0 running under WinXP Home. > > Am using... > > z = Regress[...RegressionReport->CovarianceMatrix]; > X = CovarianceMatrix /. z; > > ...to extract the given matrix. However, when I use X[[k,k]] to access > the k'th diagonal element, I get a row instead! The culprit is that > MatrixForm is the X-head (as FullForm reveals). > > How can I strip away this head and make X a list of lists? > > Thankx. > > Bruce