Skip to main content
Tweeted twitter.com/#!/StackMma/status/336528731852136448
edited title
Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

substitution rules withexcluding subscripted variables

Source Link
wdg
  • 1.2k
  • 9
  • 19

substitution rules with subscripted variables

Suppose I have an expression containing p,Subscript[p,1],Subscript[p,2],etc. I want to replace p with a numerical value while keeping the other two variables intact. How can I do it?

If I naively use /.{p->0.5} for example, I will get Subscript[0.5,1], Subscript[0.5,2] as a result.