Re: Problem with With
- To: mathgroup at smc.vnet.net
- Subject: [mg80645] Re: Problem with With
- From: "David Park" <djmpark at comcast.net>
- Date: Tue, 28 Aug 2007 02:05:50 -0400 (EDT)
- References: <fathcf$3s3$1@smc.vnet.net>
If a definition has variables or parameters on the right hand side then those variables and parameters should also appear as patterns on the left hand side. So write your definition as follows: matrix[alfa_] := {{Cos[alfa], -Sin[alfa], 0}, {Sin[alfa], Cos[alfa], 0}, {0, 0, 1}} matrix[45 =B0] {{1/Sqrt[2], -(1/Sqrt[2]), 0}, {1/Sqrt[2], 1/Sqrt[2], 0}, {0, 0, 1}} -- David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ "Miguel" <misvrne at gmail.com> wrote in message news:fathcf$3s3$1 at smc.vnet.net... > Let the matrix M={{Cos[alfa], -Sin[alfa], 0},{Sin[alfa], Cos[alfa], > 0}, {0, 0, 1}}. > > In[]: > With[{alfa=45=BA}, M] > > Out[]: > > Out[]: {{Cos[alfa], -Sin[alfa], 0},{Sin[alfa], Cos[alfa], 0}, {0, 0, > 1}} > > Mathematica does'nt evaluate the matrix. > > But > > In[]: > {{Cos[alfa], -Sin[alfa], 0},{Sin[alfa], Cos[alfa], 0}, {0, 0, > 1}}/.alfa->45=BA > > works fine. > > Any idea? > >