MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: problem of syntax.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104362] Re: [mg104340] problem of syntax.
  • From: "David Park" <djmpark at comcast.net>
  • Date: Thu, 29 Oct 2009 02:56:36 -0500 (EST)
  • References: <25979305.1256721965091.JavaMail.root@n11>

Hello Julien,

It might be interesting to know how the extra level got on the elements of
the matrix. I suspect you may have used {}, which holds a list, when you
meant to use (), which performs precedence grouping. You can't use {} or []
for precedence grouping in Mathematica. Each type of bracket has its
distinct use.

Here is a matrix with a mistaken additional level on the elements.

(testmatrix = Table[{x[i, j]}, {i, 1, 2}, {j, 1, 2}]) // MatrixForm

This flattens the rows to obtain a regular matrix.

Flatten /@ testmatrix // MatrixForm


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  


From: micmac [mailto:julien.derr at dal.ca] 

Hello everyone,

For some reasons, I have a matrix where each element is itself another
matrix of size one.
How can I transform that in a normal matrix where each element is just the
value ?

I am very confused with mathematica syntax.

thanks,

Julien



-- 
View this message in context:
http://www.nabble.com/problem-of-syntax.-tp26086236p26086236.html
Sent from the MathGroup mailing list archive at Nabble.com.





  • Prev by Date: Re: FromAdjacencyMatrix / FromAdjacencyLists - broken?
  • Next by Date: Re: Rotating an Image
  • Previous by thread: Re: problem of syntax.
  • Next by thread: Re: problem of syntax.