# 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.

61 views

### How to set similar constraints on multiple variables in Solve

In this equation: var = {x, y, z, m}; Solve[x + 2y + z + m == 14 && And @@ Thread[2 <= var <= 3], var, Integers] {{x->2,y->3,z->3,m->3},{x->3,y->...
157 views

### How to get the long logic expression with a terse method

I have a long logic expression (x==2||x==3||x==4)&&(y==2||y==3||y==4)&&(z==2||z==3||z==4)&&(m==2||m==3||m==4) How to get it by a terse ...
63 views

### How to assign options to a variable?

I want to redefine a function similar to Plot like this: ...
38 views

### Syntax question for declaring variables [duplicate]

I have a very basic syntax question for declaring $X_{hb}$ a variable. f[Subscript[X, hb_]] := Subscript[X, hb] In mathematica instead of writing the ...
173 views

### how to convert a bundle of if statements into a simple one.

hi i am just trying to create a matrix depending on some specific conditions for which i designed these codes which work fine but i want to concise these codes. ...
2k views

### Superscript prime symbol

x\[Prime] looks like $x_{'}$, ugly right? Is there a way to make a symbol with prime to look like $x'$? That's what I'm trying right now: ...
184 views

### Why is Reap result nested? [closed]

A minimal (toy) example for my question: i= 1; Reap[Do[Sow[i = (i + 1)^2], {4}]] (* {Null, {{4, 25, 676, 458329}}} *) I presume the entire result is a ...
218 views

### Why SetDelayed won't work

I'm trying to do this: Riffle[list = {a, b, c, d, e, f}, tem = RandomInteger[1, Length@list-1]] {a, 0, b, 0, c, 1, d, 0, e, 0, f} But I think this method is ...
41 views

### How to use Composition when the functions have two parameter

There are some basic instructions about Composition on this site, but I'm still confused on how to use it when the functions I am composing have two parameter, such ...
226 views

### Relational operators on vectors

How do I use relational operators on vectors? {1, 2, 3} > {0, 1, 2} (*outputs {1, 2, 3} > {0, 1, 2}*) More generally, I want ...
61 views

53 views

### Pre-define list of variables to set them in bulk

I understand this is likely tremendously simple, but I cannot work out how to do the following: vars = {b,c} *define variables* vars = {1,2} *set them* Then I ...
366 views

### Where did I go wrong with my implementation of the trapezoidal rule?

One method for doing quadrature, called the trapezoidal rule, improves accuracy by connecting the points on the curve corresponding to the points of subdivision with line segments, forming trapezoidal ...
104 views

### Extract all elements from a list that belong to a set or have a set element as an argument

EDIT: Added that I want to extract not only the variables from a specific set, but also functions involving variables from a specific set. Given the set ...
1k views

### Problem with Fourier coefficients

I have just started using Mathematica with v9.0. I am trying to follow a computation from a book on Fourier series with the function $f(x)=x$ on the interval $-\pi < x < \pi$. Here is the code ...
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$. ...
61 views

### Syntax Error for the following code

I have the following code in mathematica ...
50 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 <...
926 views

### Calling Table with custom iterator

I often find myself in situations where I, for example, need to build a table for some expression, but want to set the number of points rather then the step size, so the code ends up looking like this ...
89 views

### What explains non-working (black) variables?

I'm a bit new in Mathematica 10.3 and have had strange problem. Sometimes, variables appear in black and obviously prompt and error when used. ...
85 views

### Double arguments and place of the underscore

Could someone explain me of this bit of code below is correct: Is it possible to define a function with a second bracket, see below, i.e. f[x_][y_]? And what does ...
83 views

### what do those signs #1, #1^2, #1^3, & mean here? [duplicate]

I have read common pitfalls page and the documentation page but I still don't understand what do those signs mean here? ...
1k views

### Orthonormalization of non-hermitian matrix eigenvectors

When using Orthogonalize[] one can specify which definition of "inner product" is to be used. For example, ...
62 views

1k views

### Incompatible Changes since Mathematica Version 7?

There is documentation of the incompatible changes made to Mathematica with each major release: Incompatible Changes since Mathematica Version 1 Unfortunately that documentation simply stopped ...
65 views

### Fastest way to make division between a number and elements in a list [duplicate]

I have a list y={{a,b},{c,d},...} of dimension {10^5, 2}, and number x. I want to divide only the second part of each element of the list by x, and have as result a new list {{a,b/x},{c,d/x},...}. ...
68 views

### What does the syntax <<X>> mean? [duplicate]

What does the syntax; << X >> mean? Where X is a number? Cheers
91 views

### Check an Option without Evaluation

Consider the following: ...
2k views

### V10's Operator Forms - what are they good for?

V10 introduces an operator form for several functions perhaps primarily due to their role in queries as part of introducing data science functionality. At first pass it seems a lot of effort to add ...
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: ...
53 views

### Compile decreases the number of returned list elements

I have: LogisticMap = Compile[{μ}, ({μ, #} &) /@ Union[Drop[NestList[μ # (1 - #) &, .2, 300], 100]]]; Then: ...
25 views

### I would like know why “&” came after “FrontEndToken[”New"] here [duplicate]

I am a newbie to this Mathematica world who lives in South Korea, which is not a desirable place to have people to discuss Mathematica. So I came here, even though this question may look very simple ...
54 views

### What makes items with head Function different?

I apologize beforehand for the muddleheadedness of this question. It reflects the fact that I'm trying to interpret outward "behaviors" of Mathematica expressions without having any understanding of ...
114 views

### Binary decision diagrams (BDD) syntax error

I am new here (and to Mathematica) and would like to rebuild a simple binary decision diagram that I found here https://en.wikipedia.org/wiki/Binary_decision_diagram A code has been provided as part ...
220 views

### Nested function with an increasing argument

If, for example, I have a nesting function like Nest[1 + x^n (#) &, 1, 3] it gives the result ...
38 views

### Java anonymous functions from JLink?

JLink is really great to act on Java objects and access Java static methods. I'm asking myself if there would be a way to have access to a more recent Java syntax that allows anonymous functions, ...
115 views

### Assign variables from list inside With or Module

I have found that it is possible to assign variables from lists, as follows. r = {1, 2, 3}; {a, b, c} = r; b 2 However, ...