Linked Questions
64 questions linked to/from Injecting a sequence of expressions into a held expression
4 votes
2 answers
293 views
How can I use sequence in plotting domain?
I would like to plot a function but have a domain defined elsewhere as follows: xrange = Sequence[0, 2π]; Plot[Sin[x], {x, xrange}] However, this doesn't work ...
9 votes
1 answer
212 views
How to define a version of Table[] which localizes iteration variable by Module[]?
For reusable code it's good practice to use Module[] to localize iteration variables used by Table[], as explained by this post. ...
6 votes
1 answer
775 views
Generate regularly spaced points from the surface of simplexes
I need to generate regularly spaced samples (points) from the surface of unit simplexes with 2 or greater vertices or end points. I can generate random samples pretty straightforwardly: ...
3 votes
1 answer
2k views
How to evaluate some parts of an expression inside Hold? [duplicate]
I want to return a Hold expression but with some parts pre-evaluated. The easiest way to explain this is probably through code example. Here is what I have ...
3 votes
3 answers
473 views
How to take a part from a list without evaluating it
Consider I have a list l ...
3 votes
3 answers
217 views
Using a variable to tell Mathematica which existing variable to manipulate
I have an estimation routine I have coded up, I want now to do some tests on it where I pick a particular parameter and run the estimation for differing values of that parameter. What I want is to be ...
4 votes
1 answer
435 views
different situations with Compilation of ConstantArray
First, we load some tools related to Compile for analysis. ...
4 votes
2 answers
359 views
why set values in this way doesn't work?
question is as follows define a list ttt={1,2}; and if I set values in this way {ttt[[1]],ttt[[2]]}={3,4} then the value ...
5 votes
1 answer
205 views
Returning a sequence from a function
Let's say I want to take this plot: r = 3; DensityPlot[x^2 + y^2, {x, -r, r}, {y, -r, r}] and make the x and y limits be returned from some function (maybe because ...
4 votes
1 answer
472 views
Generate assignment code to symbols from string
I want the function to take in string, then assign a value to its corresponding symbol. An implementation using ToExpression is ...
7 votes
1 answer
274 views
Convert between string and expression representation of boxes
Boxes may be represented as expressions or as strings. How can I convert between the two forms? In particular, how can I convert from the string representation to the expression representation? ...
1 vote
1 answer
275 views
Overriding the behavior of Dot
I would like to override the behavior of Dot, so that Dot[u,v] will return a scalar instead of a 1x1 matrix in the case that the ...
3 votes
2 answers
338 views
Order of Evaluate for Map
I would like to get a list of variable names as strings. For example, x = 1; y = 2; Map[SymbolName, Unevaluated /@ Unevaluated@{x, y}] {"x", "y"} This works ...
3 votes
2 answers
246 views
HoldFirst and Hold expression as argument
I store a reference to the association in a held expression in a variable: a=<||>; b=Hold[a]; And in the code, I want to do manipulations with the original ...
0 votes
1 answer
216 views
Using sublists returned from a function as elements of a list argument to an other function
This is a contrived example, but it gets the point across. I am looking to use the following as inputs: ...