# Tagged Questions

Questions on correct (or improved) formulation of Mathematica code to achieve particular results. Use this tag (not "symbol") for questions about all those odd @@ /@ # & and ~ characters.

524 views

### Setting the DifferenceOrder Option

I've been playing around with Method in NDSolve[...] and can't quite seem to figure out how to force ...
369 views

### What's the purpose of the Unique function?

As the title says: What's the purpose of Unique? I understand that it generates some unique symbol, but when and for what is it to be used? Are there applications ...
196 views

### “A number in base b” and pure functions: why doesn't b^^# & work?

Why do the following not work (in Mathematica 7)? 2^^ # & /@ {1000, 1101} and 2^^ # & @ 1101 This does work: <...
185 views

### How to Write Partition with Infix?

The documentation says that using Infix ~, the following input f[e1,e2,e3,...] can be rewritten as ...
381 views

### Defining a function with parameters as variables

I have an expression V = (a[1] + a[2])b[1]. How would I define a function of a[1], a[2] and <...
1k views

### Integrating with multiple indicator functions

I am trying to calculate an integral involving multiple indicator functions, such as: $$h(u,v,w) = -\int_0^1 J^{\prime\prime}(s) (I_{(0,s]}(u) - s)(I_{(0,s]}(v) - s)(I_{(0,s]}(w) - s)\, dF^{-1}(s)$$...
196 views

### Is it possible to use infix notation ~ for functions with one argument or more than 2 arguments?

According to a Mathematica textbook, we can write N[x,n] by using infix notation as x ~ N ~ n. How about other functions with ...
384 views

### Explanation on why Compile statement works only if input and output sizes work

I found the following code: Compile[{{m, _Real, 2}}, Fourier[m]][Table[N[i - j], {i, 4}, {j, 4}]] which doesn't work correctly. But the following was posted as a ...
94 views

### Why does FromDigits transpose its argument (sometimes)?

a = {{1, 2}, {3, 4}, {5, 6}} ; FromDigits /@ Transpose@ a == FromDigits @ a (* True *) The only "strange" syntax I've found in the docs is But it doesn't ...
87 views

### Open a pop up window that runs a calculation in loop until it is closed?

How should I construct a code which opens a pop up window, displays a constantly updating image in it and is terminated once the pop up is closed? The constant updating would be an infinite loop of ...
130 views

### Substitution in parameters to “Which”

Why in this expression ...
530 views

### NonLinearModelFit with Two Dimensional List of Weights

I'm currently trying to fit Planck's law (B[λ, T]) to measurements, thereby determining Planck's constant. I have a list of triplets containing wavelength, ...
100 views

### Why there is no SlotSequence (##) form analogical to #[[ ;; n]]

I'm aware that this may be closed as offtopic but there are people around with "offtopic" knowledge :) So, in List context we can: ...
378 views

### local variable naming & symbolic argument

I'm stuck here with my variable assignment in this scenario ...
146 views

### How to obtain the gradient of a function as a function?

The Grad function allows me to get the gradient of a function like this: ...
95 views

### RegionUnion issues with many Regions

The new RegionUnion[] function is just what I needed if only I could get it to work. I have many non-overlapping regions that I will need to use as plotting domains ...
271 views

### Syntax error: newline character interpreted as multiplication

I'm getting this error in Wolfram Workbench, and I don't know where it comes from: "Syntax error: newline character interpreted as multiplication" This error happens around an If[] function, in a ...
564 views

### Why is Euler's number an uppercase “E” and not a lowercase “e”?

Why is Euler's number an uppercase "E" and not a lowercase "e"? Isn't Euler's Number normally expressed with a lowercase "e"?
95 views

### Cannot use Part in Pure Function [duplicate]

I need to select some lists in the nested list of form of {{1,2,3},{2,3,4}}. I have used Select to complete my work. But when I tried Position, it doesn't work. For example, ...
158 views

### How would one minimize with respect to an unknown number of variables?

Say I had a function like the following: f[n_] := Sum[a + Subscript[b, k], {k, 0, n}] Such that ...
110 views

### How to programmatically comment out multiple source files?

How to programmatically comment out the entire content of multiple .m source files assuming they start with correct Mathematica syntax? I need it to be robust so ...
455 views

### Looping with NDSolve?

I have a series of PDE equations that are solved with NDSolve for certain variables $a$ and $b$ - Now, I want to see the output at a time $t$ as $a$ and $b$ change; so I was thinking of a loop ...
78 views

### Ways to protect certain parts of expressions

I am currently working on a quantum mechanics problem where I try to find equations that relate different states of a many-body system. The states are described by sets of pairs of integers, like <...
53 views

### Using the Nest function — Confusion on my output

I have the following code and output where the original function is $f(x,a) = a^2 - x^2$. ...