Skip to main content

Questions tagged [expression-construction]

The tag has no usage guidance.

56 votes
3 answers
19k 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 ...
novice's user avatar
  • 2,345
22 votes
4 answers
1k views

Is expression in Mathematica well defined?

According to Mathematica, everything is an expression. So an atom is also an expression. But in other parts of documentation, they say that an expression is of form ...
Bob Ueland's user avatar
  • 1,069
19 votes
11 answers
2k views

Efficient way to build a certain square matrix

For odd n I'm looking for a short and swift way to construct with (f.e.) n = 3 n = 11 <...
eldo's user avatar
  • 81.5k
19 votes
2 answers
786 views

Additive SparseArray Assembly

The goal is to assemble a SparseArray in an additive fashion. Let us assume we have a large List of indices (some will be ...
leibs's user avatar
  • 758
15 votes
2 answers
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 ...
Garcia's user avatar
  • 153
11 votes
4 answers
221 views

Constraint syntax compaction

Is there a more compact way to represent these constraints: NMaximize[{a+b+c,a <= 5 && b <= 5 && c <= 5...
Jean-Baptiste's user avatar
11 votes
1 answer
307 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] ...
Naitree's user avatar
  • 1,235
11 votes
0 answers
2k views

Resources on Mathematica and strong AI (a.k.a. AGI) [closed]

David Deutsch (physicist / quantum computing theorist) wrote an article for Aeon Magazine last year: On Artificial Intelligence that got me thinking. The article assesses and critiques the ...
Jagra's user avatar
  • 14.5k
10 votes
4 answers
1k views

An inverted pyramid

I want to draw a pyramid approximately like this ...
eldo's user avatar
  • 81.5k
10 votes
3 answers
184 views

Graph that shows how symbols are used in an expression

I would like to make a graph to show how symbols build up an expression. For example, the matrix multiplication $$ \left( \begin{array}{ccc} a & b & c \\ d & e & f \\ \end{array} \...
ConvexMartian's user avatar
9 votes
5 answers
2k views

Create a list of all possible multivariate monomials of a certain order

Given variables x[i] for i=1,2,...,n I would like to create a list of all possible multivariate monomials of order ...
Kagaratsch's user avatar
8 votes
11 answers
1k views

Ragged Diamonds

diamond[n_Integer] := Table[1, {#}] & /@ (Range[n]~ Join~Range[n - 1, 1, -1]) diamond[5] // MatrixForm How could a more functional, "tablefree", solution ...
eldo's user avatar
  • 81.5k
8 votes
2 answers
265 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 ...
user27119's user avatar
  • 2,520
8 votes
3 answers
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 ...
Jesper's user avatar
  • 81
7 votes
5 answers
654 views

Elegant method of generating this matrix?

Good evening, I need to determine an elegant (as possible) method of computing an $n\times n$ matrix below (the matrix shown is just a $16\times16$ example). I've been toying with ...
gKirkland's user avatar
  • 771

15 30 50 per page
1
2 3 4 5
8