Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: Q: ReplaceAll with pattern in pattern

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18478] Re: Q: ReplaceAll with pattern in pattern
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 7 Jul 1999 23:08:41 -0400
  • Organization: Universitaet Leipzig
  • References: <7lun7p$lge@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Christoph,

you must use replace repeated //.

matrix //. shorts /. values

to resolve the additional a.

Hope that helps
  Jens

Christoph wrote:
> 
>  howdy,
> 
> At the top of a notebook i want to define some constants like that:
> 
> shorts={a -> b^2,d -> a/f}
> values={b -> 42,f -> 27}
> 
> and now i want to do some calculations using a,b,d,f as symbols:
> 
> matrix={{a,b},{d,f}}
> 
> and now I need to show the matrix:
> 
> matrix //MatrixForm
> 
> and now I want to know numerical values.
> 
> matrix /.shorts /. values
> 
> but this won't do the job. When the shorts are done, there are still
> some a left, because they were introduced with the second replacement
> rule. Is there any way to do things like that?
> 
> Greetings
>         Christoph
>


  • Prev by Date: Re: "At long last, Sir, have you no shame?"
  • Next by Date: Re: col-vector * row-vector = matrix, how ?
  • Previous by thread: Q: ReplaceAll with pattern in pattern
  • Next by thread: Re: Q: ReplaceAll with pattern in pattern