Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: mapping of function revisited

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70050] Re: mapping of function revisited
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Sun, 1 Oct 2006 04:09:39 -0400 (EDT)

On 9/27/06 at 6:05 AM, dimmechan at yahoo.com wrote:

>Searching a little more I found one more alternative

>exp1 = x^3 + (1 + z)^2;

>MapAt[Sin, exp1, Flatten[(Position[exp1, #1] & ) /@ Cases[exp1, _?(
>!NumberQ[#1] & ), {-1}], 1]]
>Sin[x]^3 + (1 + Sin[z])^2

>Are there any other alternatives? Especially with proper pattern
>matching?

<snip>

>Is it possible to obtain the previous result more compactly?

Yes,

In[4]:=
exp1 /. {x -> Sin[x], z -> Sin[z]}

Out[4]=
Sin[x]^3 + (Sin[z] + 1)^2
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Defining Solve results as variable
  • Next by Date: Re: Defining Solve results as variable
  • Previous by thread: Re: Smarter way to calculate middle-right terms of continued fraction partial sums
  • Next by thread: Re: showing variables in plots?