Re: Exponential forms and substitution
- To: mathgroup at smc.vnet.net
- Subject: [mg34486] Re: Exponential forms and substitution
- From: bghiggins at ucdavis.edu (Brian Higgins)
- Date: Thu, 23 May 2002 03:32:33 -0400 (EDT)
- References: <acffif$rrj$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Steve, I assume you have a typo in your query as Exp[2 Pi/5]==(-1)^(2/5) and not Ex[Pi/5]. Here is one way to handle your query: Let us create a matrix with some elements containg (-1)^(2/5) g=(-1)^(2/5) mat = Table[Random[Integer, {1, 5}], {5}, {5}] /. x_Integer /; x == 3 -> g Use a replacement rule mat2=mat /. x_^y_ :> Abs[x^y]*E^(I*Arg[x^y]) To convert back mat2 /. E^x_ :> (-1)^(x/(I*Pi)) And to replace with a symbol mat /. x_^(2/5) -> HoldForm[g] Cheers Brian