# Tagged Questions

Questions about functions which maintain an expression in unevaluated form, including the use and behavior of Hold, HoldForm, HoldComplete, and HoldPattern. Also questions concerning the attributes HoldFirst, HoldRest, HoldAll, etc.

71 views

### Can I hold a condition in NMaximize/NMinimize?

I'd like to use NMaximize/NMinimize with the condition ...
28 views

### How to remove a hold from a result obtained by equating a partial derivative to 0? [closed]

I have a function g(x,y). I want to set its partial derivative by $y$ equal to 0, obtain an expression depending on $x$ and use it in further calculations. However, the code I am using puts a hold on ...
76 views

### How to “INJECT” with holding Evaluation, specifically into a WhenEvent

I am importing a set of differential and stochastic equations from an external package, and want to use Mathematica to analyse this. I am struggling building the set of equations that I can use with ...
20 views

### Evaluating UnitConvert inside LogPlot

I imported several Physical Quantities with their units and doing single calculations with them works fine and return the right unit, which I can change by UnitConvert[]... For the LogPlot I made a ...
41 views

### Better alternative to Hold/ReleaseHold for postfix application of Monitor

Trying to Monitor a process using the postfix notation, as in Table[Pause[n/10], {n, 5}] // Monitor[#, n] & fails: the ...
81 views

### Matching HoldPattern expressions

My original problem is to delete all rules starts with a[1] from SubValues[a] For example, ...
65 views

### Help on order of evaluation within plot function

it is my first time asking a question here so please let me know if there's anything I should be doing that I'm unaware of. I'm sure the answer to my question already exists on the site but I'm having ...
35 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 ...
308 views

### Pattern does not match with Orderless head

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

### MatchQ failing in some cases with Hold [duplicate]

Could someone clarify why the first of these MatchQ finds a match whereas the second does not? (I'm using version 10.0, in case that matters.) ...
63 views

### Replace variable with value prior to evaluating NIntegrate

The title says it all. Reading posts such as this however, I'm not seeing how to do this. This is the simplest example that can show my problem. ...
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 ...
624 views

### How to properly inject iterators into table? [duplicate]

Goofing off on a prior question, I was fiddling with other methods, which led me to the need to inject a constructed set of iterators into a table construct. Now, ...
175 views

### Expand series unevaluated

I'm newbie in Mathematica. I'd like to obtain nice and verbose output for any series calculation. For example, given a simple sequence n*(-1)^(n-1) and ...
54 views

### Evaluate within Hold

When I do... p=3; HoldForm[Evaluate[p]-2] I get: Evaluate[p]-2 BUT I'd like to get: ...
65 views

### Is there a way to TagSet a HoldAllComplete function?

Let's say I want to overload the built-in function Lookup, to handle my data wrapped in myObject. One would use ...
427 views

### Can't inject EncryptedObject

Bug present from 10.0 to 10.3.1 and fixed in 10.4.0 !! Here are minimal examples: ...
157 views

### Passing an unevaluated part of an association to a function

I'm making a UI widget that controls sound volume on a speaker using a slider, e.g.: ...
36 views

### Customized ParallelTable - Automate ParallelSubmit - Possibly an issue with HoldAllComplete attribute

Related to this question and in particular its answer I am trying to wrap everything into a new parallelTab function that takes into account some cost per job, ...
268 views

### Calculating N-th step of recurrent sequence

I am figuring out how to calculate $N$-th step of a square root approximation sequence: $$x_{n+1} = \frac12\left(x_{n} + \frac{a}{x_n}\right),$$ where $a$ is a number the root of which is to be found ...
47 views

### Recognition Power Head for numeric value

We know: Map[Head, {a, a^2, a^3}] (* {Symbol, Power, Power} *) and Map[Head, {2, 2^2, 2^3}] all of them will be known as ...
219 views

### Defer, Hold, Unevaluated, Inactivate — which one when?

What are some guidelines on which function to select from among the superficially similar functions Defer, Hold, ...
270 views

### Held keys in associations

Jacob Akkerboom commented: Note that PositionIndex does work correctly with held expressions, whereas this is a bit painful to implement using ...
279 views

### How to inject unevaluated list of Unique into a RuleDelayed?

I am writing a function that constructs a rule which has Unique[] in the RHS. Here is a simplified segment of code ...
199 views

### How to see a code preview (in ExperimentalExplore[] or related GUI)

I have been messing around with built in ExperimentalExplore[] function. You can call the function in Mathematica yourself to see what it looks like. It is a GUI ...
38 views

### ReleaseHold NIntegrate after Replace variable

I would like to calculate the sum of square of two integral(Ex and Ey). I first hold this two integral because two variables(tx, ty) are not specified.Then, I replace tx,ty and releasehold ...
50 views

### Alter evaluation order when applying scalar multiplication to function

Consider the following program: g = 2f; g[x] (* (2f)[x] *) Is there any way I can change the above expression to have it return ...
96 views

### Replace variable with # and pass function body as an argument to a function

I have a very simple problem, which I would like to make a bit general, but none of my naive approaches have worked yet. This is what I want to do step by step: Define a parameter: ...
136 views

### Need to take infinite sum of residues, is there a way to choose the order of operations for ReleaseHold?

I'm computing an infinite sum of residues. I want to do something like this: ...
60 views

### Prevent expression from evaluation in function when using ToString

I defined function fhold Clear[fhold] SetAttributes[fhold, HoldAll] fhold[para_List] := ToString[para]; What I want is that ...
116 views

### How to properly define this function of function

I encountered real problem at first, and here is the toy example variable argument stored some expression that is generated from other parts of the program. I ...
149 views

### Why there is only HoldFirst but no HoldSecond, HoldThird, …HoldN?

I feel that this must be a duplicate. But I just can't find such a post. Mathematica has HoldFirst, HoldRest, ...
63 views

### HoldForm -> InputForm without processing the contents

I have programmatically generated a large number of simple equations like 1+1/2. I need them to be 'unprocessed', so they've been run through ...
120 views

### Why does Mathematica Hold my DSolve?

In one cell, I have ...
94 views

### Pattern matching an expression involving Times

I'm trying to write a Mathematica function that will format expressions according to my preferences, for example displaying (5 c x)/Sqrt[2] as ...
61 views

### How to evaluate an expression via LinkWrite when the expression is only known at runtime?

*** Here's the original post... I'm setting up a secondary kernel in sandbox mode with LinkLaunch, and need to pass various expressions to it for evaluation. These ...
75 views

### Table generation with SetDelayed function [closed]

I would like to understand why the following two outputs differ: Let us define the following data set: ...
55 views

### How to achieve fun[Unevaluated[f][Unevaluated[x], Unevaluated[y]] in a more elegant way?

I have defined a function fun[f_[x_,y_]]. When I call it, I want to wrap everything by Unevaluated: ...
268 views

### HoldForm[Operator ##] on some list

Recently in response to this question Mr.Wizard suggested an unusual way to summing numbers. This doesn't seem to be documented. ...
62 views

### Manipulating unevaluated expressions in nested function calls

This is a follow-up to my earlier question: Passing an unevaluated part of an association to a function I'm trying to create a modular dashboard that controls sound volume of an audio system ...
21 views

### Use functions to call a named object [duplicate]

Now I have several interpolation functions called x30, x50, z30, z50...... I wish to write a function to call these function by inputing x or z and numbers automatically, and assign a argument x to ...
113 views

### FullSimplify Produces Result that Includes Hold

Bug fixed in 10.2.0 In the course of developing a solution to Question 79183, I solved the equation ...
793 views

### How to inject an evaluated expression into a held expression? [duplicate]

I know that there are methods to structurally manipulate held expressions (discussed e.g. here), but I failed to apply those for this particular problem: ...
116 views

### How to extract a variable names (not values) from a list of transformation rules?

I am trying to extract variable names from a list of transformation rules mapping = {var1 -> 'val1', var2 -> 'val2' }. Variables ...
207 views

### Evaluation of the second argument to NIntegrate

The expression Integrate[x^2, Flatten[{{x},{1,2}}]] evaluates properly, to $\frac{7}{3}$. However, ...
74 views

### How to force evaluation of an expression with Part left unnevaluated?

My goal is to minimize a real valued multi-variable function averageFreeEnergyDensity. The function accepts an integer argument ...
216 views

...
184 views

### Nested If statement with unevaluated arguments

I have a list of boolean functions {f1, f2, f3, ...} that take a value and return True or ...