# Questions tagged [expression-construction]

The tag has no usage guidance.

101 questions
Filter by
Sorted by
Tagged with
1 vote
62 views

### Clarification of the $MemberQ$

There are a number of expressions: ...
• 1,913
1 vote
168 views

### Need to find a unique mathematical expression (not in documentation) that is as short as possible but takes a good amount of time to evaluate

I am writing a public ResourceFunction and I need a good clever use case that should not appear to emulate any examples in the official documentation but will ...
• 2,009
1 vote
107 views

### How to convert this Mathematica expression to another, as described here?

I am working on a function of which the core will consist of something like: ...
• 9,447
60 views

### Get depth of vertices in TreeGraph

I want to get the depth of each vertex in a TreeGraph, g. I might convert g into an ...
• 3,109
65 views

### Store pattern names in variables, and use them in Condition (/;)

I am trying to create patterns whose form is not hard-coded, and which are not explicitly directly written. For that I want to use one list of pattern names to name some parts of a ...
• 483
31 views

### How to turn FindFit result into function within a Module context

I'm trying to construct a 'normal' function (with formal parameter) from the FindFit result within a Module context. While this works on a global level: In := ...
250 views

Consider: ...
• 487
124 views

### Alternatives in pure function construction

When I declare a function f in the following form: f[a|b] := 1 then I can use it like: ...
• 333
1 vote
55 views

### Replacements: using condition to restrict to parts that satisfy a Boolean expression

I need to replace all integers k in a list with {k} and tried: EDITED: as a clarification: I mean all integer elements of a list, not all integers in the list, so in the following example, only 4 ...
• 1,286
32 views

### Setting pieces of "matrices" - unwanted behavior

I am constructing matrices whose elements are lists themselves (of varying length), and am (re)setting the entries of these matrices using among others the "All" command. It seems that in ...
• 180
407 views

### Creating of the Jordan Canonical Form

I have a matrix polynomial P(s) and the Jordan blocks of P(s) corresponding to every eigenvalue sj (j=1,...,k). How can the Jordan Canonical Form be generated, i.e. the block diagonal matrix which has ...
• 31
1 vote
174 views

• 1,509
51 views

### Producing the same output as Tuples[{0, 1}, 4]? [closed]

How can I use the functions decimalToBinary and padWithZeros to produce the same output as ...
314 views

### Handling multi-part equations

How are multi-part equations best handled? For example, take the torsion equation: We could express part of this equation like this: ...
• 3,956
1 vote
92 views

### How to generate expression a + a1 e1 + a2 e2 + a12 e12 (subscripted)?

Sorry to ask this twice. I thought I could get away with just a0 + a1 e1 + a2 e2 + a3 e1 e2, but for my application I can't. I can generate a + a{1} e1 + a{2} e2 + a{12} e12 (subscripted), but that's ...
• 411
194 views

### How to make RawBoxes to be Expression

expr = First@ Level[Values@ WolframLanguageData["Plot", EntityProperty["WolframLanguageSymbol", "DocumentationExampleInputs"]], {3}] Plot[Sin[...
• 24.6k
1 vote
323 views

### How can a generate an expression like a0 + a1 e1 + a2 e2 +a3 e3 + a4 e1 e2 + a5 e1 e3 + a6 e2 e3?

I wish to input n and then generate an expression. It would look like the above when $n = 3$. I would like to use subscripts for ...
• 411
318 views

### a function to extract all subexpressions from an expression

Can somebody help me with a function f such that it extract all sub expressions (i.e. looking down the expression tree) from any expression given to it and also a ...
• 8,417
78 views

### Proper formulation of Do expression [closed]

I'm having trouble with the following code: ...
• 189
1 vote
79 views

### How Defer[1+Evaluate[1+1] work?

I want to generate some expressions. The expression is not evaluated expect some parts will evaluate first. A simple example is Defer[1+1+1] and in this expression ...
• 711
58 views

...
• 24.6k
319 views

### How to overload the operator "*" as KroneckerProduct [closed]

Can I use the expression below a * b * c * d for short to instead KroneckerProduct[a,b,c,d] automatically when a,b,c,d are ...
• 711
92 views

### Solving equations with change of variables is not working?

I want to express it in the form $$\text{expr=}\int_{-\infty}^{\infty}C_1\exp\left(-t^2\right)f(t)dt$$, i.e., the integrand is a bounded smooth function $f(t)$ times $\exp(-t^2)$ and the domain of ...
529 views

### How to convert a string into a structured list

I am trying to use an efficient notation for the timing of sounds that i can play in Mathematica. I would like to parse the string "{ab{c{de}}f}" as the list ...
• 103
I define a function as f[x_] := ...;which is in fact the PDF of a random variable $X$. The PDF if given by $f_X(x)$. Let $Y$ is a random variable, which is the ...