# Tagged Questions

Questions about Mathematica's rule-based replacement functionality, including functions such as Rule (->), Replace, ReplaceAll (/.) and ReplaceRepeated (//.).

40 views

### Pretty equations in HoldForm[]

I have been generating equations programmatically, resulting in lists that look like this: {Log[2,(4^4)^3, 3 (Mod[2,4] 4), Log[root[2, 3], 4^4]} where 'root[x,y]'...
83 views

### How to replace a variable in a function?

I'm new to Mathematica and am using it for algebraic manipulation. I'm trying to figure out how to replace a variable in a user-defined function. I defined a derivative function like this: ...
326 views

### Pattern does not match with Orderless head

Why does the following pattern matching not succeed? ...
53 views

### Error in partial derivative and replace?

After run my code, output is ...
42 views

### Using ParametricPlot to Display result of Maximize

One would expect that: Plot[f[x],{x,0,1/2}] and ParametricPlot[{x,f[x]},{x,0,1/2}] would always yield identical outputs. ...
188 views

### How to prevent substitution in a part of an expression?

Background: I am trying to write a program that can execute scheme in Mathematica. Now I have things like {"+", 3, {"-", 2, {"'", {"*", 1, 3}}}}. The syntax ...
89 views

### Need explanation on strange behavior of Do together with AppendTo

We didn't expect a replacement of B. ...
82 views

### Replacing negative components of a matrix with zeros [closed]

How can I replace the negative components of a matrix with zeros?
26 views

### How to renew a value when a value is larger than it, counting the time of the record being broken at the same time [duplicate]

I have a given value and is it possible that after some calculation, when the calculated result is larger than the given value, the given value can be set as the value that is larger than it? Other ...
2k views

### Replacement inside held expression

I wish to make a replacement inside a held expression: f[x_Real] := x^2; Hold[{2., 3.}] /. n_Real :> f[n] The desired output is ...
54 views

### Extract solutions of linear system to variables

I need to output the answers from solve into the variables named just as they were named in the solve equations. I have checked out this thread Assign the results from a Solve to variable(s) but ...
26 views

### Possible incompatibility between ReplaceAll and LaplaceTransform

I have a large symbolic expression containing many terms of the form, LaplaceTransform[u2[z], z, s], with various functions for the first argument. I wish to ...
67 views

### Replacing terms in a sum according to a condition

If I have a generic expression such as ...
32 views

### How Can I combine the equations' results in a table without “x->” [closed]

For example: I have a series of functions: F[x_,o_]=x+o And I want to combine the result into a table with o=0.3,0.6,0.9.. ...
213 views

### Converting set of characters into numbers using list of replacement rules

I am trying to convert a text, as an example "aaaa" into a set of numbers as defined in a list of replacement rules, for example letterstonum . letterstonum takes in letters a to z and returns the ...
35 views

### Replacement of a group of variables in trigonometric expression

I would like to make simplification of trigonometric expressions by using a replacement a group of variables. Here the equation I have to simplify : ...
61 views

105 views

### Condition and RuleDelayed

On this site I found, for example here, some very interesting questions and answers on the use of delayed rules with conditions. I would very much like to understand these answers, but so far I failed ...
121 views

### Why is a longer pattern matched rather than a short pattern?

I was reading the Mathematica V5 Book and am a bit perplexed on the behavior of a particular pattern matching example where it seems to be choosing a longer pattern rather than a shorter pattern. The ...
25 views

### Simplifying self-reciprocal rational function [duplicate]

I have trouble transforming self-reciprocal rational functions in one variable like ...
104 views

### How can I pass replacement rules to a package-defined function and have it understand their context?

I am writing a package where I would like to be able to pass replacement rules to a function inside the package and have the function manipulate its symbols using those replacement rules. However, I'm ...
62 views

### how to replace one calaculation result to another one in a loop?

I am doing the calculation in a loop. I gain a digit for rzin in ...