MathGroup Archive 2006

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

Search the Archive

Re: mapping of function


exp111=x^3+(1+z)^2
MapAt[Sin,exp111,Position[exp111,x|z]]

On 9/27/06, dimmechan at yahoo.com <dimmechan at yahoo.com> wrote:
> Hello.
>
> I am working on John Gray's Book Mastering Mathematica.
>
> Here is one simple expression.
>
> exp1 = x^3 + (1 + z)^2
> x^3 + (1 + z)^2
>
> I am thinking of ways to map the sine function only to {x,z}.
> Here are some alternatives I considered.
>
> MapAt[Sin, exp1, Flatten[(Position[exp1, #1] & ) /@ Variables[exp1],
> 1]]
> Sin[x]^3 + (1 + Sin[z])^2
>
> MapAt[Sin, exp1, Position[exp1, _Symbol, Heads -> False]]
> Sin[x]^3 + (1 + Sin[z])^2
>
> Are there any other possibilities?
>
> Thanks for any response.
>
>


-- 
http://chris.chiasson.name/


  • Prev by Date: ScatterPlot with points of different colors
  • Next by Date: Mathematica in education
  • Previous by thread: mapping of function
  • Next by thread: Re: mapping of function