Services & Resources / Wolfram Forums
MathGroup Archive
*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

mapping of function

  • To: mathgroup at
  • Subject: [mg69914] mapping of function
  • From: dimmechan at
  • Date: Wed, 27 Sep 2006 06:05:12 -0400 (EDT)


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],
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.

  • Prev by Date: Re: How to remove just the outermost braces of a list?
  • Next by Date: equation question
  • Previous by thread: Re: C-formatted strings back to Expressions
  • Next by thread: Re: mapping of function