# Questions tagged [expression-construction]

The tag has no usage guidance.

21 questions
Filter by
Sorted by
Tagged with
16k views

### How to form a block-diagonal matrix from a list of matrices?

For example, like this: I know Join works, but it is a bit troublesome for multiple matrices. I also tried DiagonalMatrix, but ...
602 views

The goal is to assemble a SparseArray in an additive fashion. Let us assume we have a large List of indices (some will be ...
282 views

### Why can't a string be formed by head String?

Since everything is an expression in Mathematica, why must a string object be formed by "abc" but not by a String[abc] ...
2k views

### Need help coding/creating a recursive list

I have two lists A and B, each with 99 real numbers. I want to form a list, C, whose ...
190 views

### Using With[…] with a list specification as a variable [duplicate]

If you have some defined function, say f[a_, b_ c_, x], one can initialize this by using With[...] as ...
336 views

### Arrange equation in normal form

Is there a way, or if not, how could one define a function which takes an equation in any form (for example as given by FullSimplify): $$(A+X_0) x+By=3x$$ and ...
276 views

### How to represent 1 as Symbol[“Integer”]

Maybe this is a boring question, but I cannot figure it out. Because every expression has a Head, and Head[1] is ...
727 views

### Generating complete lists of polynomials

I would like to generate a list of all $3$-variable Laurent polynomials with non-negative integer coefficients using a looping construct so that I can, one-by-one, check them for specific ...
1k views

### How to create a large sparse block matrix

I need to generate a very large sparse block matrix, with blocks consisting only of ones along the diagonal. I have tried several ways of doing this, but I seem to always run out of memory. The ...
732 views

### Concatenating strings, unevaluated expressions and evaluated expressions/values

Maybe this is something very simple to some of you. Anyway, I think this can be useful to many others like me. I would like to build an output that involves strings, unevaluated expressions and ...
200 views

### Constructing expressions using Sum vs Array[… Plus] vs Plus@@Table[…]

For constructing a sum of terms which are symbolic, I noticed that in addition to ...
3k views

### Order of operations, precedence in Mathematica [duplicate]

I get confused in the order of operations in Mathematica. For example, f /@ 10^{1, 2, 3} {10, 100, 1000} In my head, that ...
179 views

### How to make RawBoxes to be Expression

expr = First@ Level[Values@ WolframLanguageData["Plot", EntityProperty["WolframLanguageSymbol", "DocumentationExampleInputs"]], {3}] Plot[Sin[...
560 views

### Getting a usable expression tree

I need to get the expression tree for some expression. expr //TreeForm The above grabs the expression tree but it isn't in some sort of usable format. Just an ...
182 views

### Write Integer powers as products

I need to wirte all occasions of (a+b)^3,Ftp^2, Sin[th]^2, ...etc as (a+b)*(a+b)*(a+b), Ftp*Ftp, Sin[th]*Sin[th], ...etc ...
262 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 ...
886 views

### How to find the lowest power of variable in expression?

If I have expression like a1/x +a2/x^2 + a3/x^3 I want to return 1/x^3. In general case, ...
191 views

### The best method of constructing a product of consecutive terms

I am new to Mathematica, I am searching for a way to create an expression with a sequence of terms such as: (x-1)/x (x-2)/x (x-3)/x (x-4)/x … (x-n)/x
810 views

### Convert string to function with an argument

I am trying to build an expression by first writing it out as a string and then using ToExpression to convert it to an expression. However, I cannot figure out how to make expression recognize x as an ...