Skip to main content

All Questions

6 votes
5 answers
734 views

Manipulating rules

I tried searching in the docs in "Transformation Rules and Definitions", however there wasn't anything of help. So imagine I have these two rules: ...
Confuse-ray30's user avatar
1 vote
1 answer
75 views

How to distinguish x[a] from x in replacement rules? [closed]

Quick to the point:is there a way to make Mathematica assume that $a \neq a[1] \neq a[2] , ...$ I notice that Solve assumes that $a$ is the same for all $a[1],a[2],...$ Also, if I replace $a \...
User0212's user avatar
1 vote
2 answers
72 views

Substituting values from an association thread into a table of expressions

I have asked a question here. Yet I am trying to do the same procedure with AssociationThread Suppose I have the following function which is a normal distribution: <...
Wiliam's user avatar
  • 3,096
4 votes
4 answers
170 views

ReplaceList doesn't apply rules down to subparts

Somewhat related to a previous question, I'm experimenting with ReplaceList to get the list of all possible transformations we can obtain by applying a rule to an expression. But I don't manage to ...
Sylvain Leroux's user avatar
2 votes
0 answers
140 views

General rule to rewrite function and argument into a new symbol

I am trying to convert Mathematica output into equations I can plug into C. I am presently trying to convert expressions of the form Derivative[1,0,0][f][t,x,y] ...
physics_researcher's user avatar
1 vote
2 answers
230 views

Suppress arguments in output for pretty print

I would like to define a rule that suppress any arguments of a function for visibility. I tried: rule = f_[x__] -> f While this works well with individual ...
Patrick.B's user avatar
  • 1,523
2 votes
1 answer
49 views

Replace sub-expressions matching a pattern unless located under specific heads

Suppose I have some rule, e.g. Re[x_] :> (x + Conjugate[x])/2. I want to apply it to all matching sub-expressions in some expression, excluding any sub-...
Vladimir Reshetnikov's user avatar
1 vote
1 answer
757 views

Convert String in Expression to Integer

I have reviewed many string replacement Q&A but I have been unable to apply them to this case (MWE): ...
Julian Moore's user avatar
  • 2,560
0 votes
1 answer
80 views

Converting indices to expression and back

lets say I want to convert this Subscript[PSternMat, 2, 13] into this PSternMat$2$13 I have written this rule ...
OhmSweetOhm's user avatar
17 votes
1 answer
324 views

When is the righthand side of a RuleDelayed evaluated?

The documentation on RuleDelayed states that lhs :> rhs represents a rule that transforms lhs to rhs, evaluating rhs only after the rule is used. Consider the ...
Fred Simons's user avatar
  • 10.2k
0 votes
1 answer
166 views

How to convert the expression '{a->a0, b->b0}' to the expression 'a=a0; b=b0'? [duplicate]

How to convert the expression '{a->a0, b->b0}' to the expression 'a=a0; b=b0'? I think this is a common question and do not know if someone has asked it before. Any help or suggestion will be ...
Eden Harder's user avatar
  • 1,145